Hi,
I just installed the python-igraph latest version using pip.
I am trying to compute the shortest path between two nodes.
I am coding in vscode, is it normal that i dont get to see the shortest path methods that are documented, but i get to see a dijkstra shortest path method that is not documented?
See the image bellow.
Our package structure is a bit convoluted due to historical reasons plus the fact that we are mixing C with Python. For instance, shortest_paths_dijkstra
is simply an alias to shortest_paths
; this is what we have in the code:
class Graph(GraphBase):
[...]
# Compatibility aliases
shortest_paths_dijkstra = GraphBase.shortest_paths
subgraph = GraphBase.induced_subgraph
What probably happens is that GraphBase
is a class implemented purely in C, so VS Code cannot look at its source code and parse it without importing the igraph
module - which it won’t do for efficiency and safety reasons. Graph
itself derives from GraphBase
and extends the class with a few Python-based methods, and you’ll be able to see the documentation for these methods only (because VS Code can parse them from the source code without having to import igraph
). If you want the full docs, you’ll have to go to python-igraph API reference to parse the full API reference.
Also, there seems to be an issue with the way i use the shortest path method.
I created a weighted directed graph using TupleList, and i clearly added the edge (0,84) with weight 10001;
but when i compute the shortest path between the two vertex, i do not get that solution;
With a weight of 70004
For the record, i do not get this issue as i initialize my graph with the usual Graph() constructor
It’s unclear what your screenshot is meant to show. Can you give a minimal reproducible example, with copyable code, according to the guidelines here?