Advanced maths

Pareto optimal path calculator with time and cost weights

List the nondominated simple routes between two vertices when each directed edge has both a time and a cost.

Your numbers

Each row: from,to; optional third weight. Empty allowed for an edgeless graph.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

List the nondominated simple routes between two vertices when each directed edge has both a time and a cost. A route belongs to the Pareto frontier when no other route improves one criterion without worsening the other. The page retains that tradeoff rather than hiding it behind an arbitrary weighted sum.

THE FORMULAPareto frontier: no route weakly improves both criteria and strictly improves one.

A worked example

Routes 0→1→3 and 0→2→3 have (time,cost)=(2,10) and (6,2). Each trades speed against cost, so neither dominates and both belong to the frontier.

Good to know

Rows from,to,time,cost, nonnegative criteria, directed n≤10. Complete simple paths≤200,000 states; tied frontier routes retained, no edge-disjoint guarantee.

Enter two additive criteria per edge

Every directed edge row contains from, to, time and cost. Both criteria must be nonnegative and are added along a route. Their units can differ, such as minutes and monetary units, because the Pareto comparison does not add the two columns together into a single score.

The model assumes route time and cost are sums independent of arrival time and previous choices. Congestion schedules, discounts after visiting a location and time-window feasibility are not represented. If such effects matter, the two additive edge columns do not capture the actual routing problem.

Two routes trade time against cost without dominating each other(2,10)(6,2)Time →; cost ↑Fast and expensiveSlow and cheapTwo Pareto labels
Routes 0→1→3 and 0→2→3 have (time,cost)=(2,10) and (6,2). Each trades speed against cost, so neither dominates and both belong to the frontier. Diagram is schematic; labels specify the numerical values.

The K shortest loopless paths calculator between two vertices ranks simple routes by a single additive cost. This page retains a Pareto frontier across time and cost, including tied nondominated routes.

Define dominance with one strict improvement

Route A dominates route B when A has no greater time and no greater cost, with at least one strictly smaller value. If one route is faster but more expensive, neither dominates the other. Equal time and equal cost do not strictly dominate each other under this page’s convention.

Consequently several distinct routes with the same frontier coordinate can all be returned. They are tied objective outcomes, not duplicate vertex paths. This preserves route alternatives without pretending that the Pareto rule distinguishes them by reliability, convenience or another criterion that was never entered.

Read the two-route example

The default diamond has route zero→one→three with time two and cost ten, and route zero→two→three with time six and cost two. The first is faster; the second is cheaper. Neither weakly improves both criteria, so both appear on the frontier.

If a third route had time seven and cost eleven, either existing route would dominate it and it would be removed. If a third route had time two and cost nine, it would dominate the original fast route while remaining incomparable with the cheap one. The comparison uses complete route totals, not local edge choices.

Keep loopless routes distinct from disjoint routes

A simple route never repeats a vertex within itself. Different returned routes can still share vertices and edges. Pareto optimality does not require failure-independent backups or separate capacity reservations, and it does not penalize shared links unless their effect is explicitly modeled as one of the input criteria.

The directed mode is fixed for this form, so an edge does not permit reverse travel without another input row. Start and end must be valid declared vertices. A missing route is not repaired by inventing a direct edge or interpreting an omitted cost as zero; every edge needs both criteria.

Understand complete enumeration and frontier filtering

For the supported small graph, the solver enumerates all simple start-to-end paths, computes their objective pairs, and removes dominated candidates. Completing that enumeration is what makes the frontier complete within the stated model. Taking only the first few routes found could miss a cheaper but longer alternative.

At most ten vertices and two hundred thousand search states are supported. A cap error means no complete frontier is certified. Asking for only a visually small subset would not make an incomplete search safe to label exhaustive, so the page rejects overlarge instances rather than quietly reporting the partial list.

Compare Pareto selection with a weighted score

A score such as time plus lambda times cost expresses one particular tradeoff in chosen units. Changing units or lambda changes that preference. The Pareto frontier leaves those decisions explicit and can include alternatives that some weighted-sum choices would never select.

The page does not identify a universally best frontier point. A user may impose a maximum affordable cost, a deadline or a utility function afterward, but those are decision rules beyond nondominance. Report the route’s two totals rather than collapsing them into an unlabelled quality number that conceals the actual compromise.

Check numerical and practical interpretation

Weights are finite decimal values and sums use floating-point arithmetic. If two route totals differ only at rounding level, the apparent dominance can be sensitive to how measurements were recorded. Keep consistent units and meaningful precision rather than using unnecessary decimal noise to rank tied practical alternatives.

The result is a discrete route comparison, not a travel-time prediction or a guarantee that an available budget will cover unmodeled charges. Shared infrastructure, uncertain times and capacity constraints can matter in a real application. Use the frontier as the transparent output of the entered two-criterion graph and validate those assumptions separately.

A few questions, answered

Does the calculator add time and cost together?

No. It keeps them separate and removes only dominated route pairs.

Are frontier routes guaranteed edge-disjoint?

No. They can share links; disjoint routing is another optimization problem.

Can equal objective pairs both appear?

Yes. Different routes with exactly equal time and cost are tied nondominated alternatives.

Does the frontier tell me which route to choose?

No. A deadline, budget or preference rule is a separate decision that the Pareto calculation leaves explicit.

Find your calculator

Start typing to explore the library.