Weighted graph
A weighted graph is a graph whose edges have associated values representing quantities such as cost, distance, strength, or frequency.
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.
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.
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 →
Also covered in
- Financial AI in Practice
- Advanced Algorithms and Data Structures
- Grokking AI Algorithms, Second Edition
- Grokking Algorithms, Second Edition
- Data Without Labels
What to know first
- edgeAn edge is a connection between two vertices or nodes in a graph or related structure, representing a relationship and optionally carrying direction, labels, or weights.
- breadth-first searchBreadth-first search is a graph or tree traversal algorithm that explores nodes in nondecreasing order of their distance from a starting node.
- directed graphA directed graph is a graph whose edges connect vertices through ordered, oriented relationships from source to destination.
- distanceA distance function assigns a numerical measure of separation or dissimilarity to pairs of points or objects in a defined space.
Related concepts
- graphkind of · A graph is a mathematical structure consisting of vertices and edges that connect pairs of vertices to represent relationships or connections.
- unweighted graphcontrasts with · An unweighted graph is a graph whose edges have no assigned numerical weights.
- Dijkstra's algorithmused by · Dijkstra's algorithm computes shortest paths from a source vertex in a weighted graph with nonnegative edge weights.
- UMAPused by · UMAP, or Uniform Manifold Approximation and Projection, is a nonlinear manifold-learning technique that embeds high-dimensional data in a lower-dimensional space while preserving important neighborhood and structural relationships.
- model weighthas part · A model weight is a learned numerical parameter that influences a machine-learning model’s computations and behavior.
Questions about weighted graph
What is weighted graph?
A weighted graph is a graph whose edges have associated values representing quantities such as cost, distance, strength, or frequency.
Which Manning books explain weighted graph?
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers, Optimization Algorithms: AI techniques for design, planning, and control problems and Graph Algorithms for Data Science.
What should I know before learning weighted graph?
Manning books that teach weighted graph usually introduce edge, breadth-first search, directed graph and distance first.
What is the difference between weighted graph and unweighted graph?
A weighted graph is a graph whose edges have associated values representing quantities such as cost, distance, strength, or frequency. An unweighted graph is a graph whose edges have no assigned numerical weights.
What is weighted graph a kind of?
Weighted graph is a kind of graph. A graph is a mathematical structure consisting of vertices and edges that connect pairs of vertices to represent relationships or connections.
What are the parts of weighted graph?
Weighted graph includes model weight.
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.


