Edge weight
An edge weight is a quantitative value associated with a graph edge that represents a property of the connection, such as its strength, cost, or distance.
Grokking Algorithms, Second Edition
An edge weight is a numerical value assigned to a graph edge to represent traversal cost, distance, time, or another quantity.
- How it is used
- Represents the cost of each graph connection so routes can be compared by total cost rather than segment count.
- How deep it goes
- Defines weights and walks through route totals, then shows how code stores and adds them.
- Examples
- Uses travel times between nodes and the money required for successive trades toward a piano.
- What you can do after
- Apply it via Dijkstra’s algorithm to compare nonnegative-weight routes and update costs when a cheaper path appears.
Read how Grokking Algorithms, Second Edition explains edge weight →
Advanced Algorithms and Data Structures
A weight is a numerical value associated with a graph edge to represent its cost, distance, or other measure.
- How it is used
- Measures graph-route cost so shortest-path algorithms can optimize distance, time, or another domain-specific objective.
- How deep it goes
- Defines path totals and priority changes, then connects them to priority-queue choices and Dijkstra running times.
- Examples
- Uses intersection maps, competing routes, road distances, and changing travel times caused by traffic or closures.
- What you can do after
- Apply it via Dijkstra’s algorithm to compare routes by accumulated cost and select an appropriate priority-queue implementation.
Read how Advanced Algorithms and Data Structures explains edge weight →
D3.js in Action, Third Edition
An edge weight is a numeric value associated with a network edge that represents the strength or quantity of its connection.
- How it is used
- Uses numeric edge values to prepare network links and communicate relationship strength in visualizations.
- How deep it goes
- Explains storage, bidirectional matrix preparation, opacity mapping, legends, and tooltips without developing broader network analysis.
- Examples
- Demonstrates shared-scene counts among Lady Capulet, the Nurse, Juliet Capulet, and Romeo Montague.
- What you can do after
- Apply it via D3.js to encode connection strength with color, opacity, legends, and interactive tooltips.
Read how D3.js in Action, Third Edition explains edge weight →
Related concepts
- Dijkstra's algorithmused by · Dijkstra's algorithm computes shortest paths from a source vertex in a weighted graph with nonnegative edge weights.
- edge labelcontrasts with · An edge label is a value associated with a graph or tree edge that identifies, describes, or specifies the relationship or key portion represented by that edge.
- learning rateconfigured by · A learning rate is a step-size parameter that controls the magnitude of updates made by an iterative learning or optimization process.
- backpropagationconfigured by · Backpropagation is a procedure for computing derivatives of an output or loss with respect to inputs and parameters by applying the chain rule backward through a computational graph.
- forward passused by · A forward pass is a calculation that propagates inputs through an ordered computational or dependency structure to produce outputs or derived values.
- language modelpart of · A language model is a computational model that represents patterns in linguistic tokens to estimate sequence probabilities and predict or generate language from context.
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.


