# LightGraphs: get all of the the shortest paths between 2 points?

**URL:** <https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775>\
**Category:** Graphs\
**Tags:** lightgraphs\
**Created:** [September 15, 2019, 1:21am UTC](https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775 "2019-09-15T01:21:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wherrera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wherrera/32/5288_2.png) [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Post date:** [September 15, 2019, 1:21am UTC](https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775/1 "2019-09-15T01:21:08Z")

</div>

Consider

```
using LightGraphs

g = SimpleDiGraph(7)
add_edge!(g, 1, 2)
add_edge!(g, 2, 3)
add_edge!(g, 4, 5)
add_edge!(g, 5, 3)
add_edge!(g, 1, 5)
add_edge!(g, 6, 7)
add_edge!(g, 7, 3)
add_edge!(g, 1, 7)

p = dijkstra_shortest_paths(g, 1)

julia> enumerate_paths(p, 3)
3-element Array{Int64,1}:
 1
 2
 3
 
rem_edge!(g, Edge(1 => 2))

p = dijkstra_shortest_paths(g, 1)
	
julia> enumerate_paths(p, 3)
3-element Array{Int64,1}:
 1
 5
 3

```

I think there must be an option that I am missing for the function call? Is there a way to get all of the same-distance shortest paths with calling dijkstra\_shortest\_paths? I would like ideally to get  
[[1, 2, 3], [1, 5, 3], [1, 7, 3]] using the original edges and a call to the djkstra routine.

---

<div class="post-metadata">

**Author:** ![fyang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fyang/32/17228_2.png) [@fyang](https://discourse.julialang.org/u/fyang)\
**Post date:** [August 30, 2020, 8:46pm UTC](https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775/2 "2020-08-30T20:46:33Z")

</div>

I have the same question here. Would appreciate any ideas!
