Graph
In mathematics and computer science, a graph (from the Greek graphos: drawing, image) is a set of objects called vertices or nodes joined by links called edges or arcs, which allow us to represent binary relationships between elements of a set. They are the object of study of graph theory.
Typically, a graph is represented graphically as a set of points (vertices or nodes) joined by lines (edges or arcs).
From a practical point of view, graphs allow us to study the interrelationships between units that interact with each other. For example, a computer network can be represented and studied by a graph, in which the vertices represent terminals and the edges represent connections (which, in turn, can be wires or wireless connections).
Virtually any problem can be represented by a graph, and its study transcends the various areas of exact sciences and social sciences.
History and problem of the Königsberg bridges
The first scientific paper on graphs was written by the Swiss mathematician Leonhard Euler in 1736. Euler based his paper on the Königsberg bridge problem. The city of Kaliningrad, originally Königsberg, is famous for its seven bridges that connect both banks of the Pregel River with two of its islands. Two of the bridges connect the main island with the eastern margin and another two with the western margin. The smaller island is connected to each bank by a bridge and the seventh bridge joins both islands. The problem posed the following: "Is it possible to take a walk starting from any of these regions, going through all the bridges, going through each one only once and returning to the same starting point?"
Abstracting this problem and posing it with the (then still basic) graph theory, Euler manages to demonstrate that the graph associated with the Königsberg bridge scheme has no solution, that is, it is not possible to return to the starting vertex without going through some edge twice.
In fact, Euler solves the more general problem: what conditions must a graph satisfy to guarantee that it can return to the starting vertex without going through the same edge more than once? If we define "degree" as the number of lines that meet at a point on a graph, then the answer to the problem is that the bridges in a town can be crossed exactly once if, except for at most two, all the points have an even degree.
Definitions
A graph G{displaystyle G} It's an orderly pair. G=(V,E){displaystyle G=(V,E)}where:
- V{displaystyle V} is a set of vertices or nodes, and
- E{displaystyle E} is a set of edges or arches, which relate these nodes.
Normally V{displaystyle V} It's usually finite. Many important results on graphs are not applicable infinite graphs.
His name is order of the graph G{displaystyle G} to his number of vertices, 日本語V日本語{displaystyle 日本語}.
The degree of a vertex or node v한 한 V{displaystyle vin V} is equal to the number of arches that have it as an end.
A loop is an edge that relates to the same node; that is, an edge where the start node and the end node coincide.
Two or more edges are parallel if they relate to the same pair of vertices.
Undirected graph
A non-directed or graph properly said It's a graph. G=(V,E){displaystyle G=(V,E)} where:
- VI was. I was. ∅ ∅ {displaystyle Vneq emptyset }
- E {x한 한 P(V):日本語x日本語=2!{displaystyle Esubseq {xin {mathcal {P}}(V): is a set of pairs not sorted elements V{displaystyle V,}.
A unordered is a set of form {a,b!{displaystyle {a,b}}, so that {a,b!={b,a!{displaystyle {a,b}={b,a}. For the graphs, these sets belong to the power set of V{displaystyle V}, denoted P(V){displaystyle {mathcal {P}(V)}}and are of cardinality 2.
Directed graph
A Targeted or Digraph It's a graph. G=(V,E){displaystyle G=(V,E)} where:
- VI was. I was. ∅ ∅ {displaystyle Vneq emptyset }
- E {(a,b)한 한 V× × V:aI was. I was. b!{displaystyle Esubseq {(a,b)in Vtimes V:aneq b},} is a set of pairs ordered of elements V{displaystyle V,}.
Give a glass (a,b){displaystyle (a,b)}, a{displaystyle a} It's his initial and b{displaystyle b} his Final node.
By definition, directed graphs do not contain loops.
A mixed graph is one that is defined with the ability to contain directed and undirected edges. Both directed and undirected graphs are particular cases of it.
Variations on the main definitions
Some applications require more general extensions to the two classic graph proposals. Although the original definition allows them, depending on the specific application may be valid or not. Sometimes V{displaystyle V} or E{displaystyle E} they can be a multiset, there can be more than one edge between each pair of vertices. The word graph (dry) can allow or not multiple edges between each pair of vertices, depending on the author of the reference consulted. If you want to highlight the absence of multiple edges between each pair of vertices (and in the case not directed, exclude loops) the graph may be called Simple.. On the other hand, if you want to ensure the possibility of allowing multiple edges, the graph may be called multigraph (sometimes the term is used pseudograph to indicate that loops and multiple edges are allowed between each pair of vertices.
Properties
- Adjacency: Two edges are adjacent if they have a common vertex, and two vertices are adjacent if an arist unites them.
- Incidence: an arist is incident to a vertice if it joins another.
- Hide: corresponds to a function that each arist associates a value (cost, weight, length, etc.), to increase the expressivity of the model. This is used much for optimization problems, such as that of the traveler or the shortest way.
- Tagged: distinction made to vertices and/or edges by a brand that makes them uniquely distinguishable from the rest.
Representation
The two main representations of graphs are as follows:
- Adjacence matrix (MA): A size matrix is used n × n where rows and columns refer to the vertices to store in each box the length between each pair of vertices of the graph. The cell MA[i, j] stores the length between the vertex i and the vertice j. If its value is infinite it means that there is no arist between those vertices, and MA[i, i] = 0.
- Adjacency list (LAW): A size vector is used n (an element for each vertex) where LAW[i] stores the reference to a list of adjacent vertices to i. In a network this list will also store the length of the edge that goes from i to the adjacent vertex.
Examples
The image is a representation of the following graph:
- V:={1,2,3,4,5,6}
- E:={{1,2},{1,5},{2,3},{2,5},{3,4},{4,5},{4,6}}
The fact that vertex 1 is adjacent to vertex 2 can be denoted as 1 ~ 2.
- In the theory of categories one Category can be considered as a multigraph directed, with objects such as vertices and morphisms as directed edges.
- In computing sciences the directed graphs are used to represent finite state machines and some other discrete structures.
- A binary relationship R in a set X It's a simple targeted graph. Two vertices a, b in X are connected by a directed edge ab Yeah. aRb.
Particular graphs
There are graphs that have remarkable properties. Some basic examples are:
- Graph null: the one who has no vertices or edges. Note that some people demand that the set of vertices is not empty in the definition of graph.
- Empty graph: the one who has no edges.
- Trivial graph: the one with a vertex and no edge.
- Simple graph: the one who has no parallel loops or edges. Check variants in this definition.
- Multigraph (or pseudograph): G is multigraph if and only if not simple. Check variants in this definition.
- Full graph: simple graph in which each pair of vertices are joined by an edge, that is, contains all possible edges.
- Bipartite Graph: be it (W,X){displaystyle (W,X)} a partition of the set of vertices V{displaystyle V}It's the one where every edge has a vertex in it. W{displaystyle W} and another one X{displaystyle X}.
- Full bipartite graph: either (W,X){displaystyle (W,X)} a partition of the set of vertices V{displaystyle V}It's the one where every vertex in W{displaystyle W} is adjacent only to each vertex in X{displaystyle X}And vice versa.
- Flat graph: the one that can be drawn on the Cartesian plane without crosses of edges.
- Tree: associated graph without cycles.
- Graph wheel: graph with n vertices that form connecting a single vertex to all the vertices of a cycle-(n-1).
- Perfect grade that the chromatic number of each induced subgraph is equal to the size of the larger clip of that subgraph.
A generalization of graphs are called hypergraphs.
Contenido relacionado
Octonion
Square
Cyclic redundancy codes algorithm