Weighted Graphs and Applications

A graph is a weighted graph if each edge is assigned a weight. Weighted graphs have many practical applications.

Figure above assumes that the graph represents the number of flights among cities. You can apply the BFS to find the fewest number of fl…


This content originally appeared on DEV Community and was authored by Paul Ngugi

A graph is a weighted graph if each edge is assigned a weight. Weighted graphs have many practical applications.

Image description

Figure above assumes that the graph represents the number of flights among cities. You can apply the BFS to find the fewest number of flights between two cities. Assume that the edges represent the driving distances among the cities as shown in Figure below. How do you find the minimal total distances for connecting all cities? How do you find the shortest path between two cities? This chapter will address these questions. The former is known as the minimum spanning tree (MST) problem and the latter as the shortest path problem.

Image description

The preceding chapter introduced the concept of graphs. You learned how to represent edges using edge arrays, edge lists, adjacency matrices, and adjacency lists, and how to model a graph using the Graph interface, the AbstractGraph class, and the UnweightedGraph class. The preceding chapter also introduced two important techniques for traversing graphs: depth-first search and breadth-first search, and applied traversal to solve practical problems. The following posts will introduce weighted graphs. You will learn the algorithm for finding a minimum spanning tree in Section and the algorithm for finding shortest paths in Section .


This content originally appeared on DEV Community and was authored by Paul Ngugi


Print Share Comment Cite Upload Translate Updates
APA

Paul Ngugi | Sciencx (2024-09-05T14:50:39+00:00) Weighted Graphs and Applications. Retrieved from https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/

MLA
" » Weighted Graphs and Applications." Paul Ngugi | Sciencx - Thursday September 5, 2024, https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/
HARVARD
Paul Ngugi | Sciencx Thursday September 5, 2024 » Weighted Graphs and Applications., viewed ,<https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/>
VANCOUVER
Paul Ngugi | Sciencx - » Weighted Graphs and Applications. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/
CHICAGO
" » Weighted Graphs and Applications." Paul Ngugi | Sciencx - Accessed . https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/
IEEE
" » Weighted Graphs and Applications." Paul Ngugi | Sciencx [Online]. Available: https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/. [Accessed: ]
rf:citation
» Weighted Graphs and Applications | Paul Ngugi | Sciencx | https://www.scien.cx/2024/09/05/weighted-graphs-and-applications-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.