Adding an edge to a directed cyclic graph
- To: mathgroup at smc.vnet.net
- Subject: [mg88908] Adding an edge to a directed cyclic graph
- From: "W_Craig Carter" <ccarter at mit.edu>
- Date: Wed, 21 May 2008 14:48:43 -0400 (EDT)
Sorry to ask a question that probably has an answer in the Combinatorica book; I've just purchased it and waiting for delivery. I am teaching myself discrete math by learning Combinatorica. Is there an obvious way to add an edge to a directed graph and have the edges renumbered associated with the cyclic order? The number of vertices are fixed. This seems like a common thing to do; so before embarking on my own code to do this, I am hoping I am missing an obvious built-in. For example: Needs["Combinatorica`"] (*c6 is the cycle in which I'd like to insert and edge*) c6 = Cycle[6, Type -> Directed] ShowGraph[c6, VertexNumber -> True, EdgeLabel -> True, EdgeLabelColor -> Darker[Orange], BaseStyle -> Large] (*here I hope to add a sub-loop to replace the edge going from 4-5*) modc6 = AddEdges[ DeleteEdge[c6, {4, 5}], { {{4, 5}, EdgeColor -> Green}, {{5, 4}, EdgeColor -> Blue}, {{4, 5}, EdgeColor -> Red} } ] (*the edge numbering no longer corresponds to the cycle index--what I need is a "ReplaceEdge"*) ShowGraph[modc6, VertexNumber -> True, EdgeLabel -> True, EdgeLabelColor -> Darker[Orange], BaseStyle -> Large] (*does anyone know an option to increase the "bowing angle" of the Graphics for the subloop?*) (*thanks*) -- W. Craig Carter
- Follow-Ups:
- Re: Adding an edge to a directed cyclic graph
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Adding an edge to a directed cyclic graph