Discovering graph concepts
In this section, we will explore some of the essential concepts in graph theory, including graph objects (such as degree and neighbors), graph measures (such as centrality and density), and the adjacency matrix representation.
Fundamental objects
One of the key concepts in graph theory is the degree of a node, which is the number of edges incident to this node. An edge is said to be incident on a node if that node is one of the edge’s endpoints. The degree of a node is often denoted by . It can be defined for both directed and undirected graphs:
- In an undirected graph, the degree of a vertex is the number of edges that are connected to it. Note that if the node is connected to itself (called a loop, or self-loop), it adds two to the degree.
- In a directed graph, the degree is divided into two types: indegree and outdegree. The indegree (denoted by ) of a node represents the number of edges that point towards that node, while the outdegree...