August 2026
Intermediate
138 pages
2h 57m
English

Suppose that you need to build a fiber-optic network rooted at police headquarters, connecting the police stations, and minimizing the total cable length–a minimum spanning tree of the graph of the stations and connecting streets. This chapter applies greedy algorithms in two ways to find a tree within a given graph that includes all the vertices and has the minimal total edge weight.
We begin by reviewing weighted graphs.
Many problems can be thought of as a graph—that is, as vertices (or “nodes”) together with edges connecting some vertex pairs. For example, the parts of a car can be thought of ...
Read now
Unlock full access