shortest_path() got an unexpected keyword argument 'weighted' (Version 1.8.1)

450 views
Skip to first unread message

LN

unread,
Mar 16, 2014, 4:47:04 PM3/16/14
to networkx...@googlegroups.com
Hi All,

I just started going through the basic of NetworkX as I intend to use if for networks definitions corresponding to constrained shortest path problems. I was playing with one of the initial examples (this is the piece of code I have:)

from networkx import *

g = DiGraph()
g.add_edge('a','b',weight=0.1)
g.add_edge('b','c',weight=1.5)
g.add_edge('a','c',weight=0.1)
g.add_edge('c','d',weight=1.0)
print shortest_path(g,'b','d')
print shortest_path(g,'b','d',weighted=True)

I am getting: "TypeError: shortest_path() got an unexpected keyword argument 'weighted'". I checked in past posts and basically the comments point to a version related issue. I verified and the version installed in my laptop is 1.8.1.

Thanks in advance for any help.

Moritz Emanuel Beber

unread,
Mar 16, 2014, 8:13:10 PM3/16/14
to networkx...@googlegroups.com
Hey,
Thanks in advance for any help.
--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To post to this group, send email to networkx...@googlegroups.com.
Visit this group at http://groups.google.com/group/networkx-discuss.
For more options, visit https://groups.google.com/d/optout.
Best,
Moritz
Reply all
Reply to author
Forward
0 new messages