sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 481 forks source link

Defect in `shortest_path_lengths` method in `generic_graph.py` #29734

Closed 09ac5a22-6a87-4290-8c34-5c8dd760bfaf closed 4 years ago

09ac5a22-6a87-4290-8c34-5c8dd760bfaf commented 4 years ago

shortest_path_lengths method in generic_graph.py makes self.weighted=True, when called with Dijkstra_Boost or Bellman-Ford_Boost See the code below

sage: G = graphs.PathGraph(7)
sage: G.weighted()
False
sage: G.shortest_path_lengths(0,algorithm='Dijkstra_Boost')
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6}
sage: G.weighted()
True

CC: @dcoudert

Component: graph theory

Keywords: gsoc20

Author: Vipul Gupta

Branch/Commit: 556f496

Reviewer: David Coudert

Issue created by migration from https://trac.sagemath.org/ticket/29734

09ac5a22-6a87-4290-8c34-5c8dd760bfaf commented 4 years ago

Commit: 556f496

09ac5a22-6a87-4290-8c34-5c8dd760bfaf commented 4 years ago

Branch: u/gh-vipul79321/ticket29734

dcoudert commented 4 years ago

Reviewer: David Coudert

dcoudert commented 4 years ago
comment:3

LGTM.

dcoudert commented 4 years ago

Changed keywords from none to gsoc20

vbraun commented 4 years ago

Changed branch from u/gh-vipul79321/ticket29734 to 556f496