Undirected graphs

An undirected graph is one in which the edges are present between vertices, but there is no specific direction identified  that is, there are no arrows at the end of the edges. Therefore, we cannot know which is the starting vertex and which one is the ending vertex. Undirected graphs are widely used in real-world applications such as Facebook and neural networks.

An edge between two vertices, a and b, in an undirected graph will mean that either of them can be a starting or ending vertex. Such an edge can be written as (a,b), that is, from a to b, as well as (b,a), that is, from b to a. The following diagram shows an undirected graph:

Figure 10.2

So, for this undirected graph, the following is the set of vertices:

(V) - { a,b,c,d,e}

Additionally, the graph will have the following set of edges:

(E) - {(a,b), (b,a), (a,c), (c,a), (a,e), (e,a), (b,e), (e,b), (b,d), (d,b), (c,d), (d,c), (c,e), (e,c)}

Now, let's begin with the recipes.