djordan99

5 Reputation

2 Badges

15 years, 3 days

MaplePrimes Activity


These are questions asked by djordan99

The AddVertex command (in GraphTheory) does not seem to copy any attributes that were set in the original graph.

with(GraphTheory):
G := CompleteGraph(5):
SetGraphAttribute(G,"graphAtt" = 1);
SetVertexAttribute(G,1,"vertexAtt" = 1);
SetEdgeAttribute(G,{1,2},"edgeAtt" = 1);
H := AddVertex(G,6):
GetGraphAttribute(H,"graphAtt");
                     ...

Does anyone know how to control the placement of the directional arrows for a digraph?

Here's an example:

with(GraphTheory):

G := Digraph(Trail(4,2,1,3,4,5),Trail(6,8,9,7,6,5));

SetVertexPositions(G,[[0,1],[1,1],[0,0],[1,0],[2,0],[3,0],[4,0],[3,1],[4,1]]);

DrawGraph(G);

produces:

The...

Can anyone help me understand why the following happens?

N := GraphTheory[Digraph]({[1,3],[3,9],[9,27]});

GraphTheory[IsNetwork](N);

and

M := GraphTheory[Digraph]({[1,2],[2,4],[4,8]}); 

GraphTheory[IsNetwork](M);

both indicate that the graph is not a network.  On the other hand, for numbers n other than 2 and 3, Maple does recognize the graph {[1,n],[n,n^2],[n^2,n^3]} as a network.

This procedure that I wrote:

Page 1 of 1