Re: Directed Graph from Adjacency Matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg58817] Re: [mg58783] Directed Graph from Adjacency Matrix
- From: Ian Roberts <mathgroup at quantica.com.au>
- Date: Tue, 19 Jul 2005 04:10:40 -0400 (EDT)
- References: <200507180721.DAA23417@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Very odd as the inbuilt function GraphPlot[{{0, 1, 0}, {0, 0, 1}, {1, 0, 0}}, EdgeStyleFunction -> Automatic] produces a cycle as you would expect. ShowGraph[Cycle[3, Type -> Directed]] produces the same graph and ToAdjacencyMatrix[Cycle[3, Type -> Directed]] produces your matrix. Looks like FromAdjacencyMatrix has a problem as, in the resulting graph, the edge between vertices 2 to 3 is missing from the Graph function's edge list. Ian confused wrote: >I am new to Mathematica. Here is my question. How would I get a >directed graph from an adjacency matrix? For instance, the 3x3 matrix >{{0,1,0},{0,0,1},{1,0,0}} defines a directed 3-cycle, but when I try to >turn it into a graph using FromAdjacencyMatrix, Mathematica returns a >graph with only two edges. > >Thank you. > > > > > >
- References:
- Directed Graph from Adjacency Matrix
- From: confused <gtg368j@mail.gatech.edu>
- Directed Graph from Adjacency Matrix