As anticipated at the beginning of this chapter, what we will face is an optimization problem or (what is the same) we will try to identify the shortest path. Graphs are data structures that are widely used in optimization problems. A graph is graphically represented by a vertex and edge structure. The vertices can be seen as events from which different alternatives (the edge) depart. Typically, graphs are used to represent a network in an unambiguous way: vertices represent individual calculators, road intersections, or bus stops, and edges are electrical connections or roads. Edges can connect vertices in any way possible.
Graph theory is a branch of mathematics that allows you to describe sets of objects together with their relationships; it was born in 1700 with Leonhard Euler.
A graph is indicated in a compact way, with G = (V, E), where V indicates...