So far, we have only dealt with creating a graph by defining the list of vertices and the connections between them. But, we haven't said anything about the characteristics of these connections. We can state that it is precisely the characteristics of the connections that have made the graphs particularly useful for the representation of a very large number of problems.
Regarding the edge, we have only distinguished between undirected and directed edges. We can add to them another type: weighted edges. Directed or undirected edges can also have a weight or a quantitative value associated with them. This property can be used to define characteristics such as distances between the nodes of a road network, the costs necessary to find a specific resource, the capacity of a line, and the energy required to move between locations along a route. Edges can...