Graph theory

Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.

IPython 6.4.0 -- An enhanced Interactive Python.

runfile('C:/Users/EM3RY_000/Anaconda3/My.Python.Programs/Internet/Strip.refs.py', wdir='C:/Users/EM3RY_000/Anaconda3/My.Python.Programs/Internet')

In, graph theory is the study of s, which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ' (also called nodes or points) which are connected by ' (also called links or lines).

The edges may be directed or undirected. For example, if the vertices represent people at a party, and there is an edge between two people if they shake hands, then this graph is undirected because any person A can shake hands with a person B only if B also shakes hands with A. In contrast, if any edge from a person A to a person B corresponds to A admiring B, then this graph is directed, because admiration is not necessarily reciprocated. The former type of graph is called an undirected graph while the latter type of graph is called a directed graph.

A multigraph is a generalization that allows multiple edges adjacent to the same pair of vertices. In some texts, multigraphs are simply called graphs.

Sometimes, graphs are allowed to contain loops, which are edges that join a vertex to itself.

Two edges of a graph are called adjacent if they share a common vertex. Two edges of a directed graph are called consecutive if the head of the first one is the tail of the second one. Similarly, two vertices are called adjacent if they share a common edge (consecutive if the first one is the tail and the second one is the head of an edge), in which case the common edge is said to join the two vertices. An edge and a vertex on that edge are called incident.