MathGroup Archive 2009

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

Search the Archive

question on constructing graphs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101609] question on constructing graphs
  • From: Randi Griffin <rgriff23 at gmail.com>
  • Date: Fri, 10 Jul 2009 23:24:54 -0400 (EDT)

Is it possible to construct weighted directed graphs with multiple edges from an asymmetric adjacency matrix in Mathematica? From the Wolfram documentation center:

FromAdjacencyMatrix[m,v,EdgeWeight]
uses v as the embedding for the resulting graph. The option Type can be used along with the EdgeWeight tag.

But when I try to do this, nothing happens:

In[334]:= 

g = FromAdjacencyMatrix[{{Infinity, 1, 3, 4, 2, 2} {3, Infinity, 3, 2,
      5, 1}, {4, 7, Infinity, 6, 2, 1}, {5, 1, 2, Infinity, 5, 
    Infinity}, {2, 1, 2, 4, Infinity, 1}, {1, 2, 1, 1, 2, Infinity}}, 
  CircularEmbedding, EdgeWeight, Type -> Directed]

Out[334]=

FromAdjacencyMatrix[{{\[Infinity], \[Infinity], 9, 8, 10, 2}, {4, 
   7, \[Infinity], 6, 2, 1}, {5, 1, 2, \[Infinity], 
   5, \[Infinity]}, {2, 1, 2, 4, \[Infinity], 1}, {1, 2, 1, 1, 
   2, \[Infinity]}}, CircularEmbedding, EdgeWeight, Type -> Directed]


The numbers are all different in the output matrix, but I don't know what is going on. I have been working with the program for about 2 months now, so still pretty new to this.


  • Prev by Date: Re: Symbolic summation
  • Next by Date: Re: Selecting Rows Based on Column Values
  • Previous by thread: Re: Data conversion
  • Next by thread: Re: question on constructing graphs