Problem Solving

Weighted Graph

Students compare marked threads between model train stations.

Weighted Graph definition

A weighted graph assigns a numerical value, called a weight, to each edge.

In Spanish
grafo ponderado
Topic
Graph theory

Weighted Graph in a picture

Weighted Graph diagramTwo low-cost edges can beat one high-cost edge.A → B costs 3First edge of the routeB → C costs 2Second edge of the routeA → B → C costs 5Compare with a direct cost of 8
Two low-cost edges can beat one high-cost edge.

How it works

Weights can represent distance, travel time, or cost. A route’s total weight is usually the sum of its edge weights. A route with fewer edges can have a larger weight if those edges are more costly. Both directed and undirected graphs can have weights.

Worked examples

Find the weight of a path with edge weights 4, 1, and 7.

4 + 1 + 7 = 12.

Is a one-edge route with weight 9 better than two edges of weights 3 and 3 if cost is minimized?

No. The two-edge route costs 6.

Can a weighted graph model travel time?

Yes. Set an edge’s weight to the time needed to travel it.

Common mistake

Add the weights along the route when the problem defines total cost that way. Counting edges gives a different measure.

Quick check

What can an edge weight represent?

Show answer

For example, length, time, or cost.

Can a directed graph have weights?

Show answer

Yes.

What is the combined weight of edges 5 and 2?

Show answer

7.

Sources

Flashcard

Weighted Graph

Reveal the definition

A weighted graph assigns a numerical value, called a weight, to each edge.

Effortless Math. “Weighted Graph.” Math Dictionary.