0
|
4836 Views
|
8 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# Why GraphPlot uses \[Rule] for edges in place of \[DirectedEdge] ?

Posted 10 years ago
 I cannot GraphPlot edges defined via [DirectedEdge]. It seems quite confusing to me. Perhaps some goes wrong in my Matematica installation?
8 Replies
Sort By:
Posted 10 years ago
 Hi Flavio, What sort of problem are you having? Perhaps you could post some code? You can find out how to do that and much more here How to post In[7]:= edges = {DirectedEdge[a, b], UndirectedEdge[b, c], DirectedEdge[c, a]} Out[7]= {a \[DirectedEdge] b, b <-> c, c \[DirectedEdge] a} In[8]:= GraphPlot[Graph@edges, DirectedEdges -> True] 
Posted 10 years ago
 The documentation page for GraphPlot seems to show that it uses Rule to identify edges. It also seems to show that each Rule indicates an edge in one direction. Thus if you want an undirected edge you give one rule for each direction. Does this work for you? GraphPlot[{1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2}, DirectedEdges -> True, VertexLabeling -> True] Click on the Details and Options on the documentation page to see more information on how to use GraphPlot.
Posted 10 years ago
 Dear David, thank you for your reply. See the attached Notebook Best Attachments:
Posted 10 years ago
Posted 10 years ago
 GraphPlot[Graph@edgeList3] if you want to use DirectedEdge.
Posted 10 years ago
 Thank you Bill. I am a mathematician. I like the neatness of Mathematica in handling formulas and data structures. For GraphPlot a list of rules being a graph is confusing! Moreover, Graph[ {list of rules}] results in a graph is a mess!? What is your opinion?
Posted 10 years ago
 I think I see the problem, Flavio. This is not well documented, but apparently GraphPlot will plot a graph either from a list of rules, or from a Graph object. Your edgeList4 is a list of rules, so GraphPlot will plot it. However, your edgeList3 is a list of edges. It needs to be made into a Graph object -- Graph[edgeList3] -- before it can be passed to GraphPlot.Best, David
Posted 10 years ago
 Thank you David. I think this is confusing. It upsets Mathematica clearness. Best, Flavio