Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.4K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

PropertyValue[{g,e}, EdgeWeight] doesn't work?

Posted 12 years ago

I've run into what looks like a bug in PropertyValue: it doesn't seem to be able to retrieve EdgeWeight's. For instance:

p0 = Graph[{Property["root" [DirectedEdge] 1, EdgeWeight -> 2.0]}, VertexLabels -> "Name"]; p0 // InputForm

Graph[{"root", 1}, {DirectedEdge["root", 1]}, {Properties -> {DirectedEdge["root", 1] -> {EdgeWeight -> 2.}}, VertexLabels -> {"Name"}}]

PropertyValue[{p0, "root" [DirectedEdge] 1}, EdgeWeight]

"$"Failed

There is also an example on the PropertyValue documentation of trying to do this, and it also shows the result "$"Failed, right there in the doco! Perhaps related, GraphDistance[p0, "root", 1], which ought to return 2.0, returns instead 1.0.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use