Discrete Mathematics
Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex Discrete Mathematics Degree Graphs Isomorphism
Graph Matrices Graph as (c) Marcin Sydow Relation
Paths and Cycles
Connectedness
Trees Contents
Discrete Mathematics Introduction
(c) Marcin Sydow Graph Digraph (directed graph) Graph
Vertex Degree of a vertex Degree Graph isomorphism Isomorphism
Graph Adjacency and Incidence Matrices Matrices Graphs vs Relations Graph as Relation Path and Cycle Paths and Cycles Connectedness Connectedness Weakly and strongly connected components Trees Tree Rooted tree Binary tree Introduction
Discrete Mathematics
(c) Marcin Sydow
Graph The role of graphs:
Vertex Degree extremely important in computer science and mathematics Isomorphism numerous important applications Graph Matrices modeling the concept of binary relation Graph as Graphs are extensively and intuitively to convey information in Relation visual form. Paths and Cycles Here we introduce basic mathematical view on graphs. Connectedness
Trees Graph (the mathematical definition)
Discrete Mathematics
(c) Marcin Sydow Graph (undirected graph) is an ordered pair of sets: Graph G = (V , E), where: Vertex Degree 1 Isomorphism V is the vertex set Graph E is the edge set Matrices
Graph as each edge e = {v, w} in E is an unordered pair of Relation vertices from V , called the ends of the edge e. Paths and Cycles
Connectedness Vertex can be also called node.
Trees
1plural form: vertices Edges and vertices
Discrete Mathematics
(c) Marcin Sydow For an edge e = {v, w} ∈ E we say: Graph the edge e connects the vertices v i w Vertex Degree the vertices v and w are neighbours or are adjacent in the Isomorphism graph G Graph Matrices the edge e is incident to the vertex v (or w). Graph as Relation a self-loop is an edge of the form (v, v).
Paths and Cycles If V and E are empty G is the zero graph, if E is empty it is an Connectedness empty graph Trees Directed graph (digraph) (mathematical definition)
Discrete Mathematics
(c) Marcin Sydow Directed graph (digraph) is an ordered pair: G = (V , E), Graph where: Vertex Degree V is the vertex set Isomorphism
Graph E is the edge set (or arc set) Matrices
Graph as each edge e = (v, w) in E is an ordered pair of vertices Relation from V , called the tail and head end of the edge e, Paths and Cycles respectively. Connectedness Example Trees Simple graphs, multigraphs and hypergraphs
Discrete Mathematics
(c) Marcin Sydow
Graph Simple graph: a graph where there are no self-loops (edges or Vertex Degree arcs of the form (v, v)). Isomorphism If there are possible multiple edges or arcs between the same Graph Matrices pair of vertices we call it a multi-graph.
Graph as Relation Notice: in a directed graph (v, w) is a different arc than (w, v)
Paths and for v 6= w. Cycles
Connectedness
Trees Picture of a graph
Discrete Mathematics
(c) Marcin Sydow
Graph A given graph can be depicted on a plane (or other Vertex Degree 2-dimensional surface) in multiple ways (example). Isomorphism A picture is only a visual form of representation of a graph. Graph Matrices It is necessary to distinguish between an abstract Graph as Relation (mathematical) concept of a graph and its picture (visual Paths and representation) Cycles
Connectedness
Trees Degree of a vertex
Discrete Mathematics
(c) Marcin Sydow
Graph Degree of a vertex v denoted as deg(v) is the number of edges Vertex Degree (or arcs) incident with this vertex. Isomorphism (note: we assume that each self-loop (v, v) contributes 2 to the Graph Matrices degree of the vertex v)
Graph as Relation If deg(v) = 0 we call it an isolated vertex. Paths and Example Cycles
Connectedness
Trees Proof: each edge contributes 2 to the sum of degrees. Corollary: sum of degrees is twice the number of edges Corollary: the number of vertices with odd degree must be even. Example
Degree sum theorem (hand-shake theorem)
Discrete Mathematics
(c) Marcin Sydow The sum of degrees of all vertices in any graph is always even. Graph Vertex (why?) Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees Degree sum theorem (hand-shake theorem)
Discrete Mathematics
(c) Marcin Sydow The sum of degrees of all vertices in any graph is always even. Graph Vertex (why?) Degree
Isomorphism Proof: each edge contributes 2 to the sum of degrees.
Graph Matrices Corollary: sum of degrees is twice the number of edges
Graph as Relation Corollary: the number of vertices with odd degree must be
Paths and even. Cycles
Connectedness Example
Trees Degrees in directed graphs
Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex In directed graphs: indegree of a vertex v (indeg(v)): number Degree of arcs that v is the head of Isomorphism
Graph outdegree of a vertex v (outdeg(v)): number of arcs that v is Matrices the tail of Graph as Relation Example Paths and Cycles
Connectedness
Trees Degree sum theorem for digraphs
Discrete Mathematics
(c) Marcin Sydow
Graph The sum of indegrees of all vertices is equal to the sum of Vertex Degree outdegrees of all vertices in any directed graph. Isomorphism Proof: each arc contributes 1 to the indegree sum and 1 to the Graph Matrices outdegree sum.
Graph as Relation Corollary: sum of indegrees (outdegrees) is equal to the number
Paths and of arcs in a digraph. Cycles
Connectedness
Trees Graph Isomorphism
Discrete Mathematics
(c) Marcin Sydow Two graphs G1(V1, E1), G2(V2, E2) are isomorphic ⇔ there exists a bijection f : V1 → V2 so that: Graph
Vertex v, w are connected by an edge (arc) in G1 ⇔ Degree f (v), f (w) are connected by an edge (arc) in G2. Isomorphism Graph The function f is called isomorphism between graphs G and Matrices 1
Graph as G2. Relation Example Paths and Cycles Interpretation: graphs are isomorphic if they are “the same” Connectedness from the point of view of the graph theory (they can have Trees different names of vertices or be differently depicted, etc.). Subgraph and induced graph
Discrete Mathematics
(c) Marcin Sydow Subgraph of graph G = (V , E) is a graph H = (V 0, E 0) so that Graph V 0 ⊆ V and E 0 ⊆ E and any edge from E 0 has both its ends in Vertex 0 Degree V . Isomorphism Example Graph Matrices A subgraph of G induced by a set of vertices V 0 ⊆ V is a Graph as 0 0 Relation subgraph G of G whose vertex set is V whose edges (arcs) are 0 Paths and all edges (arcs) of G that have both ends in V . Cycles
Connectedness Example
Trees empty graph Nn (n vertices, no edges) (example)
full graph Kn (a simple graph of n vertices and all possible edges (arcs)) (example) bi-partite graph (its set of vertices can be divided into two disjoint sets so that any edges (arcs) are only between the sets) (example)
full bi-partite graph Km,n (a bipartite graph that has all possible edges (arcs))
path graph Pn (example)
cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow
Graph
Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees full graph Kn (a simple graph of n vertices and all possible edges (arcs)) (example) bi-partite graph (its set of vertices can be divided into two disjoint sets so that any edges (arcs) are only between the sets) (example)
full bi-partite graph Km,n (a bipartite graph that has all possible edges (arcs))
path graph Pn (example)
cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph
Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees bi-partite graph (its set of vertices can be divided into two disjoint sets so that any edges (arcs) are only between the sets) (example)
full bi-partite graph Km,n (a bipartite graph that has all possible edges (arcs))
path graph Pn (example)
cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees full bi-partite graph Km,n (a bipartite graph that has all possible edges (arcs))
path graph Pn (example)
cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism bi-partite graph (its set of vertices can be divided into two Graph Matrices disjoint sets so that any edges (arcs) are only between the Graph as sets) (example) Relation
Paths and Cycles
Connectedness
Trees path graph Pn (example)
cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism bi-partite graph (its set of vertices can be divided into two Graph Matrices disjoint sets so that any edges (arcs) are only between the Graph as sets) (example) Relation
Paths and full bi-partite graph Km,n (a bipartite graph that has all Cycles possible edges (arcs)) Connectedness
Trees cyclic graph Cn (example)
Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism bi-partite graph (its set of vertices can be divided into two Graph Matrices disjoint sets so that any edges (arcs) are only between the Graph as sets) (example) Relation
Paths and full bi-partite graph Km,n (a bipartite graph that has all Cycles possible edges (arcs)) Connectedness path graph Pn (example) Trees Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism bi-partite graph (its set of vertices can be divided into two Graph Matrices disjoint sets so that any edges (arcs) are only between the Graph as sets) (example) Relation
Paths and full bi-partite graph Km,n (a bipartite graph that has all Cycles possible edges (arcs)) Connectedness path graph Pn (example) Trees cyclic graph Cn (example) Some important graph families
Discrete Mathematics (c) Marcin (all graphs below are simple graphs) Sydow empty graph Nn (n vertices, no edges) (example) Graph full graph Kn (a simple graph of n vertices and all possible Vertex Degree edges (arcs)) (example) Isomorphism bi-partite graph (its set of vertices can be divided into two Graph Matrices disjoint sets so that any edges (arcs) are only between the Graph as sets) (example) Relation
Paths and full bi-partite graph Km,n (a bipartite graph that has all Cycles possible edges (arcs)) Connectedness path graph Pn (example) Trees cyclic graph Cn (example) Adjacency Matrix
Discrete Mathematics
(c) Marcin Sydow
Graph For a graph G = (V , E), having n vertices its adjacency Vertex Degree matrix is a square matrix A having n rows and columns indexed Isomorphism by the vertices so that A[i, j] = 1 ⇔ vertices i, j are adjacent, Graph Matrices else A[i, j] = 0.
Graph as (in case of self-loop (i, i), A[i, i] = 2) Relation
Paths and Example Cycles
Connectedness
Trees for undirected graphs the matrix is symmetric (AT = A) for simple graphs the diagonal of A contains only zeros sum of numbers in a row i: degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix:
Graph
Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees the matrix is symmetric (AT = A) for simple graphs the diagonal of A contains only zeros sum of numbers in a row i: degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees for simple graphs the diagonal of A contains only zeros sum of numbers in a row i: degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees the diagonal of A contains only zeros sum of numbers in a row i: degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees sum of numbers in a row i: degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees degree of i (outdegree for digraphs) sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees sum of numbers in a column i: degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs)
Graph as Relation
Paths and Cycles
Connectedness
Trees degree of i (indegree for digraphs) for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs) Graph as sum of numbers in a column i: Relation
Paths and Cycles
Connectedness
Trees for directed graphs AT reflects the graph with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs) Graph as sum of numbers in a column i: degree of i (indegree for Relation
Paths and digraphs) Cycles
Connectedness
Trees with all the arcs “inversed”
Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs) Graph as sum of numbers in a column i: degree of i (indegree for Relation
Paths and digraphs) Cycles for directed graphs AT reflects the graph Connectedness
Trees Examples
Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs) Graph as sum of numbers in a column i: degree of i (indegree for Relation
Paths and digraphs) Cycles for directed graphs AT reflects the graph with all the arcs Connectedness “inversed” Trees Some Simple Observations
Discrete Mathematics
(c) Marcin Some simple relations concerning properties of a graph and Sydow properties of its adjacency matrix: Graph for undirected graphs the matrix is symmetric (AT = A) Vertex Degree for simple graphs the diagonal of A contains only zeros Isomorphism sum of numbers in a row i: degree of i (outdegree for Graph Matrices digraphs) Graph as sum of numbers in a column i: degree of i (indegree for Relation
Paths and digraphs) Cycles for directed graphs AT reflects the graph with all the arcs Connectedness “inversed” Trees Examples Incidence matrix
Discrete Mathematics
(c) Marcin Sydow
Graph An incidence matrix I of an undirected graph G: the rows
Vertex correspond to vertices and columns correspond to edges (arcs). Degree I [v, e] = 1 ⇔ v is incident with e (else I[v,e]=0) Isomorphism
Graph Example Matrices
Graph as For directed graphs: the only difference is the distinction Relation between v being the head (=1) or the tail (=-1) of e Paths and Cycles Example Connectedness
Trees Graphs vs relations
Discrete Mathematics
(c) Marcin Sydow
Graph Each directed graph naturally represents any binary relation
Vertex R ∈ V × V . (i.e. E is the set of all pairs of elements from V Degree that are in the relation) Isomorphism
Graph Example Matrices
Graph as Each undirected graph naturally represents any symmetric Relation binary relation Paths and Cycles Example Connectedness
Trees self-loop on each vertex symmetric relation: undirected graph or always mutual arcs transitive relation: for any path there is a “short” arc anti-symmetric relation: no mutual arcs, always self-loops inverse of the relation: each arc is inversed
Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees undirected graph or always mutual arcs transitive relation: for any path there is a “short” arc anti-symmetric relation: no mutual arcs, always self-loops inverse of the relation: each arc is inversed
Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: self-loop on each vertex Degree
Isomorphism symmetric relation:
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees for any path there is a “short” arc anti-symmetric relation: no mutual arcs, always self-loops inverse of the relation: each arc is inversed
Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: self-loop on each vertex Degree
Isomorphism symmetric relation: undirected graph or always mutual arcs Graph transitive relation: Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees no mutual arcs, always self-loops inverse of the relation: each arc is inversed
Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: self-loop on each vertex Degree
Isomorphism symmetric relation: undirected graph or always mutual arcs Graph transitive relation: for any path there is a “short” arc Matrices
Graph as anti-symmetric relation: Relation
Paths and Cycles
Connectedness
Trees each arc is inversed
Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: self-loop on each vertex Degree
Isomorphism symmetric relation: undirected graph or always mutual arcs Graph transitive relation: for any path there is a “short” arc Matrices
Graph as anti-symmetric relation: no mutual arcs, always self-loops Relation inverse of the relation: Paths and Cycles
Connectedness
Trees Observations on analogies between relations and graphs
Discrete Mathematics
(c) Marcin Sydow
Graph Vertex reflexive relation: self-loop on each vertex Degree
Isomorphism symmetric relation: undirected graph or always mutual arcs Graph transitive relation: for any path there is a “short” arc Matrices
Graph as anti-symmetric relation: no mutual arcs, always self-loops Relation inverse of the relation: each arc is inversed Paths and Cycles
Connectedness
Trees Path
Discrete Mathematics
(c) Marcin Sydow Path: an alternating sequence of vertices and edges Graph (v0, e0, v1, eq,..., vk , ek ,..., vl ) so that each edge ek is incident Vertex Degree with vertices vk , vk+1. We call it a path from v0 to vl . Isomorphism (sometimes it is convenient to define path just as a subsequence Graph Matrices of vertices or edges of the above sequence) Graph as Relation Example
Paths and Cycles Directed path in a directed graph is defined analogously (the Connectedness arcs must be directed from vk to vk+1 Trees Paths cont.
Discrete Mathematics
(c) Marcin Sydow
Graph simple path: no repeated edges (arcs) Vertex Degree elementary path: no repeated vertices Isomorphism Examples Graph Matrices length of a path: number of its edges (arcs) Graph as Relation (assume: 0-length path is a single vertex) Paths and Cycles Example Connectedness
Trees Distance in graph
Discrete Mathematics
(c) Marcin Sydow Distance between two vertices is the length of a shortest
Graph path between them.
Vertex Degree The distance function in graphs d : V × V → N has the
Isomorphism following properties:
Graph Matrices d(u, v) = 0 ⇔ u == v Graph as (only in undirected graphs) it is a symmetric function, i.e. Relation ∀u, v ∈ V d(u,v) = d(v,u) Paths and Cycles triangle inequality: ∀u, v, w ∈ V it holds that Connectedness d(u, v) + d(v, w) ≥ d(u, w) Trees Cycle
Discrete Mathematics
(c) Marcin Sydow
Graph cycle: a path of length at least 3 (2 for directed graphs) where Vertex the beginning vertex equals the ending vertex v0 == vl (also Degree called a closed path) Isomorphism
Graph Example Matrices
Graph as analogously: directed cycle, simple cycle, elementary cycle Relation (except the starting and ending vertices there are no repeats) Paths and Cycles Examples Connectedness
Trees Connectedness
Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex Degree A graph is connected ⇔ for any two its vertices v,w there Isomorphism exists a path from v to w Graph Matrices Example Graph as Relation
Paths and Cycles
Connectedness
Trees Connected component of a graph
Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex Degree Connected component of a graph is its maximal subgraph Isomorphism that is connected. Graph Matrices Example (why “maximal”)? Graph as Relation
Paths and Cycles
Connectedness
Trees Strongly connected graph
Discrete Mathematics
(c) Marcin Sydow (only for directed graphs)
Graph A directed graph is stronlgy connected ⇔ for any pair of its
Vertex vertices v,w there exists a directed path from v to w. Degree
Isomorphism Example Graph A directed graph is weakly connected ⇔ for any pair of its Matrices
Graph as vertices v,w there exists undirected path from v,w (i.e. the Relation directions of arcs can be ignored) Paths and Cycles note: strong connectedness implies weak connectedness (but Connectedness not the opposite) Trees Example Strongly and weakly connected components
Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex Strongly connected component: a maximal subgraph that is Degree strongly connected Isomorphism
Graph Weakly connected component: a maximal subgraph that is Matrices weakly connected Graph as Relation Examples Paths and Cycles
Connectedness
Trees Drzewa
Discrete Mathematics
(c) Marcin Sydow Tree is a graph that is connected and does not contain cycles (acyclic). Graph Vertex Example Degree Isomorphism Forest is a graph that does not contain cycles (but does not Graph have to be connected) Matrices Graph as Example Relation
Paths and A leaf of a tree is a vertex that has degree 1. Cycles
Connectedness Other vertices (nodes) are called internal nodes of a tree. Trees Example T is a tree of n vertices T has exactly n-1 edges (arcs) and is acyclic T is connected and has exactly n-1 edges (arcs) T is connected and removing any edge (arc) makes it not connected any two vertices in T are connected by exactly one elementary path T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph
Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees T has exactly n-1 edges (arcs) and is acyclic T is connected and has exactly n-1 edges (arcs) T is connected and removing any edge (arc) makes it not connected any two vertices in T are connected by exactly one elementary path T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees T is connected and has exactly n-1 edges (arcs) T is connected and removing any edge (arc) makes it not connected any two vertices in T are connected by exactly one elementary path T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree T has exactly n-1 edges (arcs) and is acyclic
Isomorphism
Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees T is connected and removing any edge (arc) makes it not connected any two vertices in T are connected by exactly one elementary path T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree T has exactly n-1 edges (arcs) and is acyclic Isomorphism T is connected and has exactly n-1 edges (arcs) Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees any two vertices in T are connected by exactly one elementary path T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree T has exactly n-1 edges (arcs) and is acyclic Isomorphism T is connected and has exactly n-1 edges (arcs) Graph Matrices T is connected and removing any edge (arc) makes it not Graph as connected Relation
Paths and Cycles
Connectedness
Trees T is acyclic and adding any edge makes exactly one cycle
Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree T has exactly n-1 edges (arcs) and is acyclic Isomorphism T is connected and has exactly n-1 edges (arcs) Graph Matrices T is connected and removing any edge (arc) makes it not Graph as connected Relation
Paths and any two vertices in T are connected by exactly one Cycles elementary path Connectedness
Trees Equivalent definitions of a tree
Discrete Mathematics
(c) Marcin Sydow The following conditions are equivalent:
Graph T is a tree of n vertices Vertex Degree T has exactly n-1 edges (arcs) and is acyclic Isomorphism T is connected and has exactly n-1 edges (arcs) Graph Matrices T is connected and removing any edge (arc) makes it not Graph as connected Relation
Paths and any two vertices in T are connected by exactly one Cycles elementary path Connectedness T is acyclic and adding any edge makes exactly one cycle Trees Rooted tree
Discrete Mathematics
(c) Marcin Sydow A rooted tree is a tree with exactly one distinguished node called its root. Graph
Vertex Example Degree
Isomorphism Distinguishing the root introduces a natural hierarchy among
Graph the nodes of the tree: the lower the depth the higher the node Matrices in the hierarchy. Graph as Relation Picture of a rooted tree: root is at the top, all nodes of the Paths and Cycles same depth are on the same level, the higher the depth, the Connectedness lower the level on the picture. Trees Example Terminology of rooted trees
Discrete Mathematics
(c) Marcin A depth of a vertex v of a rooted tree, denoted as depth(v) is Sydow its distance from the root. Graph Height of a rooted tree: maximum depth of any its node Vertex Degree ancestor of a vertex v is any vertex w that lies on any path Isomorphism from the root to v, v is then called a descendant of w (the Graph Matrices root does not have ancestors and the leaves do not have
Graph as descendants) Relation
Paths and a ancestor w of a neighbour (adjacent) vertex v is called the Cycles parent of v, in this case v is called the child of w. Connectedness
Trees if vertices u, v have a common parent we call them siblings Examples Binary tree
Discrete Mathematics
(c) Marcin Sydow
Graph Binary tree is a rooted tree with the following properties: Vertex Degree
Isomorphism each node has maximally 2 children Graph for each child it is specified whether it is left or right child Matrices of its parent (max. 1 left child and 1 right child) Graph as Relation Paths and Example Cycles
Connectedness
Trees Summary
Discrete Mathematics
(c) Marcin Sydow Mathematical definition of Graph and Digraph Graph Degree of a vertex Vertex Degree Graph isomorphism Isomorphism Adjacency and Incidence Matrices Graph Matrices Graphs vs Relations
Graph as Relation Path and Cycle Paths and Connectedness Cycles
Connectedness Weakly and strongly connected components Trees Tree, Rooted tree, Binary tree Example tasks/questions/problems
Discrete Mathematics give the mathematical definitions and basic properties of the (c) Marcin discussed concepts and their basic properties (in particular: Sydow graph, digraph, degree, isomorphism, adjacency/incidence
Graph matrix, path and cycle, connectedness and connected components, trees (including rooted and binary trees) Vertex Degree make picture of the specified graph of one of the discussed Isomorphism families (full, bi-partite, etc.) Graph Matrices given a picture of a graph provide its mathematical form (pair Graph as of sets) and adjacency/incidence matrix and vice versa Relation Paths and check whether the given graphs are isomorphic and prove your Cycles answer Connectedness
Trees find connected components of a given graph (or weakly/strongly connected components for a digraph) specify the height, depth, number of leaves, etc. of a given rooted tree Discrete Mathematics
(c) Marcin Sydow
Graph
Vertex Degree Isomorphism Thank you for your attention. Graph Matrices
Graph as Relation
Paths and Cycles
Connectedness
Trees