Skip to content

Commit 2ad007e

Browse files
committed
Graph library - removed useless condition
1 parent 2b4089c commit 2ad007e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

2021/graph.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,7 @@ def dijkstra(self, start, end=None):
386386
continue
387387

388388
# Adding for future examination
389-
if type(neighbor) == complex:
390-
heapq.heappush(frontier, (current_distance + weight, neighbor))
391-
else:
392-
heapq.heappush(frontier, (current_distance + weight, neighbor))
389+
heapq.heappush(frontier, (current_distance + weight, neighbor))
393390

394391
# Adding for final search
395392
self.distance_from_start[neighbor] = current_distance + weight

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy