You are on page 1of 5

Graphs Why graphs? - To solve many practical applications such as telecommunication, chemistry, computational models and so on. Muligraphs.

A graph that has a loops or multiple edges. Simple graphs. A graph with neither loops nor multiple edges. Degree of a vertex Is the # of edges incident with it. Degree of sequence Sequence formed from the degrees of its vertices, usually arranged in descending order of size. Theorem In any graph, the sum of the degrees of the vertices is an even number. Path Is an alternation sequence of vertices and deges of the form with no repeated edges. Cycle Is a sequence of distinct vertices and edges, that begins and ends at the same vertex. Graph summery. Repeated edge? Path Simple path Circuit(cycle) Simple circuit No No No No Repeated vertex? Allowed No Allowed First & Last only Star & Ends at same point! Allowed No Yes Yes

Connected and disconnected graphs. Two vertices u and v in a graph G is said to be connected if there is there is a path in G from u to v. the graph G is connected if every pair of vertices are connected. Otherwise G is said to be “disconnected”. Directed Graphs. A graph in which every edge has a direction assigned to it. The directed edges are often called “Arcs”.  Out degree – the number of arcs directed out (away from) the given vertex.  In degree – the number of arcs directed into (towards) the given vertex.

Let G be a graph and let v & w be two distinct vertices of G. Ore’s Theorem. 1) The same # of components. 4) The same degree sequence. And all other vertices of G have even degree. Dirac’s Theorem  If G is a simple graph with n vertices (n>= 3) such that the degree of every vertex in G is at least n/2. v & w has odd degree. passes through every vertex of G at least once. Then G and H have. 5) The same # of paths of any gien length k 6) The same # of cycles of any given length k If any of these 6 conditions are violated. and traverses every edge of G exactly once. that passes through every vertex exactly once is called a “Hamilton Path”. .Isomorphism of graphs. then vertex of the graph has an even degree. If G is a simple graph with n vertices (n>=3) such that the degreeof every vertex in G is at least n/2. 2) The same # of vertices. 3) The same # of edges. Theorem. Euler circuit. A way of representing the graph in a computer. An Euler path from v to w is a sequence of adjacent edges and vertices that starts at v. v of a graph G are said to be adjacent if they are joined by an edge Let G and H be isomorphic graphs. Then G has a Hamilton circuit. There is an Euler path form v to w if and only if. That passes through every vertex exactly once is called a “Hamilton circuit”. ends at w.  Hamilton circuit – A simple circuit in a graph G.  Theorem If a graph has a Euler circuit. Let G be a graph and let v and w be two distinct vertices of G. Adjacency matrix and Adjacency list. G is connected.  Hamilton path – A simple path in a graph G. # of adjacency – two vertices u. An Euler circuit for G is a circuit that contains every vertex of the graph has an even degree. the given graphs are not isomorphic. Euler Path. Then G has a Hamilton circuit.

Used extensively in applications in computer science and data networking.Trees Properties of tree Tree is a undirected.  Given vertices v & w. Forrest Is a graph which contains trees that are not necessarily connected. them it is called “Spanning tree”. Spanning tree. Definitions  Level of a vertex – Is the number of edges along the unique path between it and the root. then H is called a “Spanning sub graph of G”/ If a spanning sub graph is also a tree. V (H) = V (G). H is a sub graph if G if its vertices are a subset of the vertex set of G and it’s edges are a subset of the edge set of G.  Given any internal vertex v of a rooted tree. Finite state machines.  If w is a child of v. Rooted tree A tree in which one vertex has been singled our (designated) as the root and every edge is directed away from the root. connected graph that contains. then v is an “ancestor” of w is a “descendant” of u. the “children” of v are all those vertices that are adjacent to v and are one level further away from the root than v. no cycles. if v lies on the unique path between w & the root. . V (H) ⊆ V (G) and E (H) ⊆ E (G) If H is a sub graph of G such that.  Two vertices that are both children of the same parent are called “siblings”.  Height of a rooted tree – Is the maximum level to any vertex of the tree. then v is called the “parent” of w. That is.

Compound statements are built by combining two or more statements. The converse is “if q then p”. And otherwise true. the bi-conditional of p and q is “p iff q” and is denoted by . It is true if both p and q have the same truth values and is false if p and q have opposite truth values. Propositions A proposition (or statement) is a sentence that is true or false. And ^ Or v Not ~ If p is a proposition variable.Logic. But not both. 2. Compound propositions. 1. when p is true and q is false. p q pq T T T T F F F T T F F T Contra positive of a conditional statement Contra positive of a condition statement of the form “If p then q” is “if ~q and ~p”. Implications. Necessary and sufficient conditions. Bi conditional statement () Given statement variables p & q. The converse and inverse of conditional statement Suppose a conditional statement of the form “If p then q” is given. If p and q are statements P is a sufficient for q means “if p then q” P is a necessary condition for q means “if not a then not q” . the negation of p is “not P”/ Sri lanka is as island  negation = Sri Lanka is not an Island. (Conditional statement) The implications pq is the proposition that is false. The inverse is “if ~p then ~q”.

Proper subset = A is a proper subset of B. Functions. . Q= set of all rational numbers.Predicates and quantified statement R= set of all real numbers. Set theory. Z= set of all integers. iff every element of A is in B but there is at least one element of B that is not in A. Cartesian product of sets. N= set of all natural numbers. Disjoint set. denoted AxB is the set of all ordered pairs (a. The Cartesian products of A and B. they have no common elements. Each element of X is related to unique element of Y. Two sets are called disjoint iff. b) where a is in A and b is in B.