Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: number of Trangles in a graph-network

  • To: mathgroup at
  • Subject: [mg99373] Re: number of Trangles in a graph-network
  • From: Peter Pein <petsie at>
  • Date: Mon, 4 May 2009 06:00:18 -0400 (EDT)
  • References: <gtefaf$197$>

Luca Cinacchio schrieb:
> Greetings,
> having a graph (network, i.e. one created with RandomGraph) wich can have  
> not connected nodes, I would like to count the total number of triangles  
> inside the graph.
> I gave a look to Combinatorica and its related book by Pemmaraju Skiena,  
> but I did'nt find any solution (maybe I am wrong). Do you know if there is  
> a easy way to answer this problem with Mathematica and/or Combinatorica?
> Thanks in advance.

The following does not check for triples of points being colinear, but it 
seems to be a possible starting point:

In[1]:= <<Combinatorica`
In[2]:= List@@(rg=RandomGraph[7,2/3])
In[3]:= GraphPlot@rg
Out[4]= 13


  • Prev by Date: Re: Solving the system with inexact coefficients
  • Next by Date: Re: DumpSave of InterpolatingFunction increases its execution times
  • Previous by thread: number of Trangles in a graph-network
  • Next by thread: Re: number of Trangles in a graph-network