Weighted graphs

If all the edges of a graph are weighted edges, then the graph is known as a weighted graph. We will talk a lot about weighted graphs in the upcoming sections. Weighted graphs can be directed or undirected graphs. Each edge must have a value associated with it. The weight of an edge is always referred to as the cost of the edge. The following diagram represents an undirected weighted graph with five vertices and seven edges. Here, the weight of the edge between vertex 1 and 2 is 2, the edge between vertex 1 and 4 is 5, and the edge between vertex 4 and 5 is 58:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset