Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.

Slides:



Advertisements
Similar presentations
Chapter 11 Trees Graphs III (Trees, MSTs) Reading: Epp Chp 11.5, 11.6.
Advertisements

CS 336 March 19, 2012 Tandy Warnow.
Trees Chapter 11.
Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Chen213.shu.edu.cn.
Analysis of Algorithms Depth First Search. Graph A representation of set of objects Pairs of objects are connected Interconnected objects are called “vertices.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
1 Minimizing Movement Erik D. Demaine, MohammadTaghi Hajiagahayi, Hamid Mahini, Amin S. Sayedi-Roshkhar, Shayan Oveisgharan, Morteza Zadimoghaddam SODA.
Discussion #36 Spanning Trees
Graph. Undirected Graph Directed Graph Simple Graph.
Network Optimization Problems: Models and Algorithms This handout: Minimum Spanning Tree Problem.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 10, Monday, September 22.
Assignment 4. (Due on Dec 2. 2:30 p.m.) This time, Prof. Yao and I can explain the questions, but we will NOT tell you how to solve the problems. Question.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Graphs.
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
5.4 Shortest-path problem  Let G=(V,E,w) be a weighted connected simple graph, w is a function from edges set E to position real numbers set. We denoted.
Introduction to Operations Research
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Lecture 17 Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
 Rooted tree and binary tree  Theorem 5.19: A full binary tree with t leaves contains i=t-1 internal vertices.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Introduction to Graph Theory
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
EMIS 8373: Integer Programming Combinatorial Relaxations and Duals Updated 8 February 2005.
Discrete Mathematics Chapter 5 Trees.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
Graphs Upon completion you will be able to:
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
5.6 Prefix codes and optimal tree Definition 31: Codes with this property which the bit string for a letter never occurs as the first part of the bit string.
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
Trees.
Proof technique (pigeonhole principle)
Graph Graphs and graph theory can be used to model:
Introduction to Algorithms
Discrete Mathematicsq
Graph theory Definitions Trees, cycles, directed graphs.
12. Graphs and Trees 2 Summary
Graph Theory and Algorithm 01
Advanced Algorithms Analysis and Design
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Elementary graph algorithms Chapter 22
Trees.
CS 583 Analysis of Algorithms
Autumn 2015 Lecture 10 Minimum Spanning Trees
Problem Solving 4.
Theorem 5.13: For vT‘, l’(v)= min{l(v), l(vk)+w(vk, v)}
Elementary graph algorithms Chapter 22
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Graphs and Trees This handout: Trees Minimum Spanning Tree Problem

Terminology of Graphs: Cycles, Connectivity and Trees A path that begins and ends at the same node is called a cycle. Example: Two nodes are connected if there is a path between them. A graph is connected if every pair of its nodes is connected. A graph is acyclic if it doesn’t have any cycle. A graph is called a tree if it is connected and acyclic.

Examples/Applications of Trees Family tree Evolutionary tree Possibility tree Prime number factorization tree Spanning tree of a telecom network (considered later in this handout) Hydrocarbon molecules

Properties of Trees Definition: Let T be a tree. If T has at least 3 nodes, then A node of degree 1 in T is called a leaf (or a terminal node). A node of degree greater than 1 is called an internal node. Lemma: Every tree with more than one node has at least one leaf. Theorem: For any positive integer n, any tree with n nodes has n-1 edges. Proof by induction (blackboard).

Properties of Trees Lemma: If G is any connected graph, C is a cycle in G, and one of the edges of C is removed from G, then the graph that remains is still connected. Theorem: For any positive integer n, if G is a connected graph with n vertices and n-1 edges, then G is a tree. if G is an acyclic graph with n vertices and n-1 edges, then G is a tree. Proofs on blackboard.

Rooted Trees Definition: A rooted tree is a tree in which one vertex is distinguished from the others and is called the root. The level of a vertex is the number of edges along the unique path between it and the root. The height of a rooted tree is the maximum level to any vertex of the tree. The children of a vertex v are those vertices that are adjacent to v and one level farther away from the root than v. When every vertex in a rooted tree has at most two children, the tree is called a binary tree. r a b c d

Minimum Spanning Tree Problem Given: Graph G=(V, E), |V|=n Cost function c: E  R . Goal: Find a minimum-cost spanning tree for V i.e., find a subset of arcs E*  E which connects any two nodes of V with minimum possible cost. Example: Min. span. tree: G*=(V,E*) G=(V,E) 2 3 4 5 7 8 2 3 4 5 7 8 e b c d a e b c d a Red bold arcs are in E*

Algorithm for solving the Minimum Spanning Tree Problem Initialization: Select any node arbitrarily, connect to its nearest node. Repeat Identify the unconnected node which is closest to a connected node Connect these two nodes Until all nodes are connected Note: Ties for the closest node are broken arbitrarily.

The algorithm applied to our example Initialization: Select node a to start. Its closest node is node b. Connect nodes a and b. Iteration 1: There are two unconnected node closest to a connected node: nodes c and d (both are 3 units far from node b). Break the tie arbitrarily by connecting node c to node b. 2 3 4 5 7 8 e b c d a Red bold arcs are in E*; thin arcs represent potential links. 2 3 4 5 7 8 e b c d a

The algorithm applied to our example Iteration 2: The unconnected node closest to a connected node is node d (3 far from node b). Connect nodes b and d. Iteration 3: The only unconnected node left is node e. Its closest connected node is node c (distance between c and e is 4). Connect node e to node c. All nodes are connected. The bold arcs give a min. spanning tree. 2 3 4 5 7 8 e b c d a 2 3 4 5 7 8 e b c d a