@tjoneslo , et al, a program's invariants are like a building's foundations - you need them to build a solid building (or program). Invariants describe conditions that must always hold for your program to have a chance of running correctly.
The existing code was only generating at most one of the forward or reverse routes from star A to star B, so I enforced that behaviour.
The positive-edge-cost invariant actually applies to A* pathfinding itself, not PyRoute directly, but (as you can see in the commit), enforcing it saves a lot of hassle.
Start implementing the during-generation invariants I listed here: https://github.com/makhidkarun/traveller_pyroute/issues/16#issuecomment-991689038
@tjoneslo , et al, a program's invariants are like a building's foundations - you need them to build a solid building (or program). Invariants describe conditions that must always hold for your program to have a chance of running correctly.
The existing code was only generating at most one of the forward or reverse routes from star A to star B, so I enforced that behaviour. The positive-edge-cost invariant actually applies to A* pathfinding itself, not PyRoute directly, but (as you can see in the commit), enforcing it saves a lot of hassle.