Make an algorithm check include its invalid inputs
Does a shortest-path implementation return known distances and reject inputs outside its assumptions?
Make this plan your own ↓Read, edit and export without an account. This is preparation; no run or result is claimed.
What to compare
The pilot contains three small controls. Broader properties need a stated generator, input contract, qualified environment and independently specified checks.
Useful outputs
- Hand-enumerated distances for the fixed small graph.
- Explicit negative-edge and reachable-negative-cycle controls.
- An extension plan separating algorithm correctness from graph-ordering performance.
Inputs and prerequisites
- The original fixed example is prepared for isolated standard-library execution.
- NetworkX/SciPy/Hypothesis dependency environments remain unqualified for this collection.
What this work would not establish
- A few examples cannot establish general correctness or a speedup.
- Do not execute source repositories on the developer host.
Start with these sources.
Small shortest-path solvers with negative-weight controls
Provide Dijkstra and Bellman–Ford implementations with hand-enumerated reference graphs, explicit negative-edge rejection, and a negative-cycle control.
NetworkX
Graph construction, traversal, structural analysis, and network algorithms in Python.
Compressed Sparse Graph Routines (scipy.sparse.csgraph)
A tutorial on algorithms for graphs represented as sparse matrices, illustrated through path finding.
[Re] Speedup Graph Processing by Graph Ordering
A C++ replication about graph ordering as a way to change graph-processing performance.
Hypothesis
Property-based testing tools that generate and simplify test inputs.
Make the question your own.
Edit freely. Export a copy before reloading or leaving. Your text stays in this tab until you choose to copy, download or save it privately.