Graph Theory
Total Page:16
File Type:pdf, Size:1020Kb
Definitions Graph Theory Types of Graphs Trajectories and Circuits Probabilistic Graphical Models Graph Isomorphism L. Enrique Sucar, INAOE Trees Cliques Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 1 / 32 Outline Definitions 1 Definitions Types of Graphs 2 Types of Graphs Trajectories and Circuits Graph 3 Trajectories and Circuits Isomorphism Trees 4 Graph Isomorphism Cliques Perfect 5 Trees Ordering Ordering and 6 Cliques Triangulation Algorithms References 7 Perfect Ordering 8 Ordering and Triangulation Algorithms 9 References (INAOE) 2 / 32 Definitions Graphs Definitions Types of • A graph provides a compact way to represent binary Graphs relations between a set of objects Trajectories and Circuits • Objects are represented as circles or ovals, and Graph Isomorphism relations as lines or arrows Trees • There are two basic types of graphs: undirected graphs Cliques and directed graphs Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 3 / 32 Definitions Directed Graphs Definitions Types of Graphs Trajectories and Circuits Graph Isomorphism • A directed graph or digraph is an ordered pair, Trees G = (V ; E), where V is a set of vertices or nodes and E Cliques is a set of arcs that represent a binary relation on V Perfect Ordering • Directed graphs represent anti-symmetric relations Ordering and between objects, for instance the “parent” relation Triangulation Algorithms References (INAOE) 4 / 32 Definitions Undirected Graphs Definitions Types of Graphs Trajectories and Circuits Graph • An undirected graph is an ordered pair, G = (V ; E), Isomorphism where V is a set of vertices or nodes and E is a set of Trees edges that represent symmetric binary relations: Cliques Perfect (Vj ; Vk ) 2 E ! (Vk ; Vj ) 2 E Ordering • Undirected graphs represent symmetric relations Ordering and Triangulation between objects, for example, the “brother” relation Algorithms References (INAOE) 5 / 32 Definitions More Definitions Definitions Types of Graphs Trajectories • If there is an edge Ei (Vj ; Vk ) between nodes j and k, and Circuits then Vj is adjacent to Vk Graph Isomorphism • The degree of a node is the number of edges that are Trees incident in that node Cliques • Two edges associated to the same pair of vertices are Perfect Ordering said to be parallel edges Ordering and Triangulation Algorithms References (INAOE) 6 / 32 Definitions More Definitions Definitions Types of Graphs Trajectories and Circuits Graph • A vertex that is not an endpoint to any edge is an Isomorphism isolated vertex –it has degree 0 Trees • In a directed graph, the number of arcs pointing to a Cliques Perfect node is its in degree Ordering • The number of edges pointing away from a node is its Ordering and Triangulation out degree Algorithms References (INAOE) 7 / 32 Types of Graphs Types of Graphs (I) Definitions Chain graph: a hybrid graph that has directed and Types of undirected edges. Graphs Simple graph: a graph that does not include cycles and Trajectories and Circuits parallel arcs. Graph Multigraph: a graph with several components (subgraphs), Isomorphism Trees such that each component has no edges to the Cliques other components, i.e., they are disconnected. Perfect Complete graph: a graph that has an edge between each Ordering pair of vertices. Ordering and Triangulation Bipartite graph: a graph in which the vertices are divided in Algorithms two subsets, G1; G2, such that all edges References connect a vertex in G1 with a vertex in G2; that is, there are no edges between nodes in each subset. Weighted graph: a graph that has weights associated to its edges and/or vertices. (INAOE) 8 / 32 Types of Graphs Types of Graphs (II) Definitions Types of Graphs Trajectories and Circuits Graph Isomorphism Trees Cliques Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 9 / 32 Trajectories and Circuits Trajectories Definitions Types of • A trajectory is a sequence of edges, E ; E ; :::; E such Graphs 1 2 n Trajectories that the final vertex of each edge coincides with the and Circuits initial vertex of the next edge in the sequence Graph Isomorphism • A simple trajectory does not include the same edge two Trees o more times; an elemental trajectory is not incident on Cliques the same vertex more than once Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 10 / 32 Trajectories and Circuits Circuits Definitions • A circuit is a trajectory such that the final vertex Types of coincides with the initial one Graphs Trajectories • A simple circuit does not include the same edge two or and Circuits more times; an elemental circuit is not incident on the Graph Isomorphism same vertex more than once (except the initial/final Trees vertex) Cliques Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 11 / 32 Trajectories and Circuits Directed Acyclic Graphs Definitions Types of Graphs Trajectories and Circuits Graph Isomorphism Trees • A DAG is a directed graph that has no directed circuits Cliques (a directed circuit is a circuit in which all edges in the Perfect sequence follow the directions of the arrows) Ordering Ordering and Triangulation Algorithms References (INAOE) 12 / 32 Trajectories and Circuits Problems Definitions • Finding a trajectory that includes all edges in a graph Types of Graphs only once (Euler trajectory). Trajectories and Circuits • Finding a circuit that includes all edges in a graph only Graph once (Euler circuit). Isomorphism Trees • Finding a trajectory that includes all vertices in a graph Cliques only once (Hamiltonian trajectory). Perfect • Ordering Finding a circuit that includes all vertices in a graph only Ordering and once (Hamiltonian circuit). Triangulation Algorithms • Finding a Hamiltonian circuit in a weighted graph with 1 References minimum cost (Traveling salesman problem) . 1In this case the nodes represent cities and the edges roads with an associated distance or time, so the solution will provide a traveling salesman with the “best” (minimum distance or time) route to cover all the cities. (INAOE) 13 / 32 Graph Isomorphism Isomorphism (I) Definitions Types of Graphs Trajectories and Circuits • Two graphs are isomorphic if there is a one to one Graph correspondence between their vertices and edges, so Isomorphism that the incidences are maintained Trees Cliques • Types: Perfect 1 Graph isomorphism. Graphs G1 and G2 are isomorphic. Ordering 2 Subgraph isomorphism. Graph G1 is isomorphic to a Ordering and Triangulation subgraph of G2 (or vice versa). Algorithms 3 Double subgraph isomorphism. A subgraph of G1 is References isomorphic to a subgraph of G2. (INAOE) 14 / 32 Graph Isomorphism Isomorphism (II) Definitions Types of Graphs Trajectories and Circuits Graph Isomorphism Trees Cliques Perfect Ordering Ordering and Triangulation Algorithms References • Determining if two graphs are isomorphic (type 1) is an NP problem; while the subgraph and double subgraph isomorphism problems (type 2 and 3) are NP-complete (INAOE) 15 / 32 Trees Undirected trees Definitions • An undirected tree is a connected graph that does not Types of Graphs have simple circuits Trajectories and Circuits • There are two classes of vertices or nodes in an Graph undirected tree: (i) leaf or terminal nodes, with degree Isomorphism one; (ii) internal nodes, with degree greater than one Trees Cliques Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 16 / 32 Trees Properties Definitions Types of Graphs Trajectories and Circuits Graph • There is a simple trajectory between each pair of Isomorphism vertices. Trees Cliques • The number of vertices, j V j, is equal to the number of Perfect edges, j E j plus one: j V j=j E j +1. Ordering • Ordering and A tree with two or more vertices has at least two leaf Triangulation Algorithms nodes. References (INAOE) 17 / 32 Trees Directed trees • A directed tree is a connected directed graph such that Definitions Types of there is only a single directed trajectory between each Graphs pair of nodes Trajectories and Circuits • A rooted tree has a single node with an in degree of Graph zero (the root node) and the rest have in degree of one Isomorphism • A polytree might have more than one node with in Trees degree zero (roots), and certain nodes (zero or more) Cliques with in degree greater than one Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 18 / 32 Trees Terminology (I) Definitions Root: a node with in degree equal to zero. Types of Leaf: a node with out degree equal to zero. Graphs Internal node: a node with out degree greater than zero. Trajectories and Circuits Parent / Child: if there is a directed arc from A to B, A is Graph parent of B and B is a child of A. Isomorphism Trees Brothers: two or more nodes that have the same parent. Cliques Ascendants /Descendants: if there is a directed trajectory Perfect from A to B, A is an ascendant of B and B is a Ordering descendant of A. Ordering and Triangulation Subtree with root A: a subtree with A as its root. Algorithms Subtree of A: a subtree with a child of A as its root. References K-ary Tree: a tree in which each internal node has at most K children. It is a regular tree if each internal node has K children. Binary Tree: a tree in which each internal node has at most two children. (INAOE) 19 / 32 Trees Terminology (II) Definitions Types of Graphs Trajectories and Circuits Graph Isomorphism Trees Cliques Perfect Ordering Ordering and Triangulation Algorithms References (INAOE) 20 / 32 Cliques Complete set and subsets Definitions Types