Statistical Methods

Check Minimum Costs Through a Directed Network

Define the task

Represent a workflow network with nodes and directed edges only when an edge has a defined, additive cost. A transition from A to B does not automatically allow travel from B to A. Document units, permitted transitions and whether costs can change over time. This teaching tool handles small matrices with positive edge costs; off-diagonal zero denotes no edge, so a genuine zero-cost transition cannot be represented. Diagonal entries must be zero.

Carry out the check

The tool applies the Floyd–Warshall recurrence to compare a direct route with routes through intermediate nodes. Unreachable pairs are reported as unreachable rather than assigned zero cost. Negative costs are rejected, and the tool returns minimum totals rather than a recommended real-world pathway. A shortest route may be unsuitable when constraints include capacity, deadlines, safety, uncertainty or mutually exclusive activities. Review those constraints separately. Save the adjacency matrix and node order; interpreting an undirected matrix as directed can change both reachability and costs.

Worked hypothetical example

In a fictional three-node network, A→B costs 2, B→C costs 3 and A→C costs 9. The minimum A→C cost is 5 through B, while C→A remains unreachable when no reverse edges exist. The matrix rows are (0,2,9), (0,0,3), (0,0,0). Verify that diagonal costs remain zero and that adding a more expensive alternative does not improve a minimum. This arithmetic example makes no claim about an actual care pathway.

Method checked 16 November 2026 against SciPy documentation: shortest_path.

Open the directed minimum route costs.

Download the directed network edge and reachability worksheet.

Related reading

Reading path: Analyze data. Guide 158 of 162. Choose any guide to suit your project.

Statistical Methods

Audit a Minimum-Cost One-to-One Pairing

Practical steps and a hypothetical example: Find a minimum-cost one-to-one pairing from a declared cost matrix.

Statistical Methods

Interpret a Weibull shape through survival and cumulative hazard

Inspect how a Weibull shape changes cumulative hazard and survival. Includes a worked hypothetical example and checks for parameter-transfer errors.

Browse this reading pathTools for this stageGuides and downloads for this stage