Finding all cycles in a graph
- To: mathgroup at smc.vnet.net
- Subject: [mg47290] Finding all cycles in a graph
- From: "Anupama Shivaprasad" <anupama at docomolabs-usa.com>
- Date: Fri, 2 Apr 2004 03:31:01 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi all, I am trying to find the cycles in a graph, more speifically a complete graph. The function FindCycle, available in the Discrete Math package finds one cycle that is present in the graph and the function ExtractCycles, extracts a cycle, deletes that cycle and trys to find more cycles in the deleted cycle graph. I was wondering if there was some routine that somone here happened to have that could compute and display all the cycles in an undirected complete graph. For Example, if I had a complete graph of 4 vertices, then the cycles for the same would be: {1,2,4,1} {1,3,4,1} {1,2,3,1} {2,3,4,2} {1,2,3,4,1} Thanks, Anu