liveBook · Manning

Weighted graph

A weighted graph is a graph whose edges have associated values representing quantities such as cost, distance, strength, or frequency.

How 3 Manning books explain it

Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

A weighted graph is a graph whose edges have associated values representing connection costs or other quantities.

How it is used
Represents connection distances for minimum-cost network construction and shortest routes between cities.
How deep it goes
Builds generic weighted edges and adjacency lists, then walks through priority-queue implementations of spanning-tree and shortest-path searches.
Examples
Uses mile-weighted links among 15 U.S. metropolitan areas, a 5372-mile spanning tree, and a 2605-mile Los Angeles–Boston route.
What you can do after
Build it from scratch as a generic Swift graph and apply it to minimum spanning trees and single-source shortest paths.

Read how Classic Computer Science Problems in Swift: Essential techniques for practicing programmers explains weighted graph →

Optimization Algorithms: AI techniques for design, planning, and control problems

A graph whose edges have numerical weights representing quantities such as distance or cost.

How it is used
Models distances, costs, times, or connection speeds so graph routes and relationships can be compared quantitatively.
How deep it goes
Defines edge weights and demonstrates NetworkX construction, then connects them to shortest-path search without deriving algorithm internals.
Examples
Uses road networks with distance or cost and telecommunications devices whose edges carry Mbps connection speeds.
What you can do after
Operate/configure weighted graphs with NetworkX and visualize nodes, edges, and numerical labels.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains weighted graph →

Graph Algorithms for Data Science

A weighted network is a graph whose relationships carry numerical values representing strength, cost, frequency, or another quantity.

How it is used
Represents relationship strength or traversal cost in network models.
How deep it goes
Defines numerical relationship weights and explains when higher or lower values are preferred.
Examples
Uses friendship relationships, transportation networks, and projected retweet networks as examples of weighted analysis.
What you can do after
Evaluate whether relationship values should be maximized for strength or minimized for traversal cost.

Read how Graph Algorithms for Data Science explains weighted graph →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.