Newly introduced to Julia, after working with slow graph libraries in Python. I’m trying to find the shortest path through a graph, constructed through an adjacency matrix using
Part of my confusion is whether if 1) I’m misunderstanding the syntax, or 2) I’m wrong to pass objects constructed in Python into packages written in Julia. For some reason I am unable to find even a simple path from a source and a target. Would someone be able to give a quick comment?
import numpy as np import julia from julia import LightGraphs, SimpleWeightedGraphs # create transition matrix in numpy (Python) trans_mat = np.array([[0, 3, 0], [0, 0, 1], [0, 0, 0]]) # create graph using Julia (LightGraphs) g = SimpleWeightedGraphs.SimpleWeightedDiGraph(trans_mat) # find shortest path using A_star (without heuristic, becomes Dijkstra) LightGraphs.a_star(g, 1, 3) >>> 
EDIT1: I found one such solution, which seems very cumbersome. Is there a more elegant solution?
source = 1 target = 3 LightGraphs.enumerate_paths(LightGraphs.dijkstra_shortest_paths(g, source), target))