Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

VertexAdd seems to forget EdgeWeight values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119478] VertexAdd seems to forget EdgeWeight values
  • From: Julian Francis <julian.w.francis at gmail.com>
  • Date: Sun, 5 Jun 2011 07:05:12 -0400 (EDT)

Dear all,

It seems that when you add a vertex to a graph with EdgeWeight's, that
the old edge weights are not carried over to the new graph. Is this a
bug?

In[561]:=
graph1 = Graph[{1, 2}, {1 \[DirectedEdge] 2}, EdgeWeight -> {5}];

In[557]:= PropertyValue[{graph1, 1 \[DirectedEdge] 2}, EdgeWeight]

Out[557]= 5

In[562]:= graph2 = VertexAdd[graph1, 6];

In[560]:= PropertyValue[{graph2, 1 \[DirectedEdge] 2}, EdgeWeight]

Out[560]= $Failed

Thanks,
Julian.


  • Prev by Date: Re: fibonacci question
  • Next by Date: Question about function construction
  • Previous by thread: Parallel NDSolve
  • Next by thread: Question about function construction