MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Directed Graph from Adjacency Matrix


You need to use the option Type->Directed
look at the following code
<< DiscreteMath`Combinatorica`
(g = FromAdjacencyMatrix[{{0, 1,
 0}, {0, 0, 1}, {1, 0, 0}}, Type -> Directed]) // ShowGraph
good luck
yehuda

On 7/18/05, confused <gtg368j at mail.gatech.edu> 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.
> 
>


  • Prev by Date: Re: Directed Graph from Adjacency Matrix
  • Next by Date: Re: benchmark
  • Previous by thread: Directed Graph from Adjacency Matrix
  • Next by thread: Re: Directed Graph from Adjacency Matrix