MathGroup Archive 2009

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

Search the Archive

Re: question on constructing graphs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101673] Re: question on constructing graphs
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Tue, 14 Jul 2009 05:34:14 -0400 (EDT)
  • References: <h390ln$jov$1@smc.vnet.net>

Hi Randi,

You forgot one comma in the matrix (between the first and second rows)
and you should not use the word CircularEmbedding, for, as far as I
know, it is not an option of FromAdjacencyMatrix.

Cheers -- Sjoerd

On Jul 11, 5:24 am, Randi Griffin <rgrif... at gmail.com> wrote:
> Is it possible to construct weighted directed graphs with multiple edges =
from an asymmetric adjacency matrix in Mathematica? From the Wolfram docume=
ntation center:
>
> FromAdjacencyMatrix[m,v,EdgeWeight]
> uses v as the embedding for the resulting graph. The option Type can be u=
sed 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: Plot Label at bottom with quote marks
  • Next by Date: Re: Plot Label at bottom with quote marks
  • Previous by thread: question on constructing graphs
  • Next by thread: Re: Add syntax highlighting to own command