Skip to content

Unify Dijkstra on the efficient priority-queue implementation #7458

Description

@DenizAltunkapan

Description

Under datastructures/graphs/ there are two Dijkstra variants:

Keeping a naive O(V²) version alongside an "optimized" one is mostly a maintenance burden. For an educational repo it is clearer to expose one correct, efficient implementation: the priority-queue based version running in O((V + E) log V).

Proposed change

  • Keep a single Dijkstra implementation based on a PriorityQueue.
  • If the naive version is kept for teaching purposes, document explicitly why both exist and how they differ in complexity, instead of leaving two near-identical classes side by side.

Related

Companion to #7454, which removes the misplaced third copy in others/.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions