Directed Graphs. digraph search transitive closure topological sort strong components. References: Algorithms in Java, Chapter 19
|
|
|
- Polly Whitehead
- 10 years ago
- Views:
Transcription
1 Directed Graphs digraph search transitive closure topological sort strong components References: Algorithms in Java, Chapter
2 Directed graphs (digraphs) Set of objects with oriented pairwise connections. one-way streets in a map dependencies in software modules prey-predator relationships hyperlinks connecting web pages Page ranks with histogram for a larger example 2
3 Digraph applications digraph vertex edge financial stock, currency transaction transportation street intersection, airport highway, airway route scheduling task precedence constraint WordNet synset hypernym Web web page hyperlink game board position legal move telephone person placed call food web species predator-prey relation infectious disease person infection citation journal article citation object graph object pointer inheritance hierarchy class inherits from control flow code block jump 3
4 Some digraph problems Transitive closure. Is there a directed path from v to w? Strong connectivity. Are all vertices mutually reachable? Topological sort. Can you draw the digraph so that all edges point from left to right? PERT/CPM. Given a set of tasks with precedence constraints, how we can we best complete them all? Shortest path. Find best route from s to t in a weighted digraph PageRank. What is the importance of a web page? 4
5 Digraph representations Vertices this lecture: use integers between 0 and V-1. real world: convert between names and integers with symbol table. Edges: four easy options list of vertex pairs vertex-indexed adjacency arrays (adjacency matrix) vertex-indexed adjacency lists vertex-indexed adjacency SETs Same as undirected graph BUT orientation of edges is significant
6 Adjacency matrix digraph representation Maintain a two-dimensional V V boolean array. For each edge v w in graph: adj[v][w] = true. to one entry for each edge from
7 Adjacency-list digraph representation Maintain vertex-indexed array of lists. 0 0: : : 3: 4: 3 one entry for each edge 3 4 5: 4 3 6: : 8 8: 9: : 11: 12 12: 7
8 Adjacency-SET digraph representation Maintain vertex-indexed array of SETs. 0 0: 1: 2: : 4: 3 one entry for each edge 3 4 5: 6: : 8: 8 9: : 11: 12: 12 8
9 Adjacency-SET digraph representation: Java implementation Same as Graph, but only insert one copy of each edge. public class Digraph private int V; private SET<Integer>[] adj; public Digraph(int V) this.v = V; adj = (SET<Integer>[]) new SET[V]; for (int v = 0; v < V; v++) adj[v] = new SET<Integer>(); public void addedge(int v, int w) adj[v].add(w); adjacency SETs create empty V-vertex graph add edge from v to w (Graph also has adj[w].add[v]) public Iterable<Integer> adj(int v) return adj[v]; iterable SET for v s neighbors 9
10 Digraph representations Digraphs are abstract mathematical objects, BUT ADT implementation requires specific representation. Efficiency depends on matching algorithms to representations. representation space edge between v and w? iterate over edges incident to v? list of edges E E E adjacency matrix V 2 1 V adjacency list E + V degree(v) degree(v) adjacency SET E + V log (degree(v)) degree(v) In practice: Use adjacency SET representation Take advantage of proven technology Real-world digraphs tend to be sparse [ huge number of vertices, small average vertex degree] Algs all based on iterating over edges incident to v. 10
11 Typical digraph application: Google's PageRank algorithm Goal. Determine which web pages on Internet are important. Solution. Ignore keywords and content, focus on hyperlink structure. Random surfer model. Start at random page. With probability 0.85, randomly select a hyperlink to visit next; with probability 0.15, randomly select any page. PageRank = proportion of time random surfer spends on each page. Solution 1: Simulate random surfer for a long time. Solution 2: Compute ranks directly until they converge Solution 3: Compute eigenvalues of adjacency matrix! None feasible without sparse digraph representation Every square matrix is a weighted digraph
12 digraph search transitive closure topological sort strong components 12
13 Digraph application: program control-flow analysis Every program is a digraph (instructions connected to possible successors) Dead code elimination. Find (and remove) unreachable code can arise from compiler optimization (or bad code) Infinite loop detection. Determine whether exit is unreachable can t detect all possible infinite loops (halting problem) 13
14 Digraph application: mark-sweep garbage collector Every data structure is a digraph (objects connected by references) Roots. Objects known to be directly accessible by program (e.g., stack). Reachable objects. Objects indirectly accessible by program (starting at a root and following a chain of pointers). easy to identify pointers in type-safe language Mark-sweep algorithm. [McCarthy, 1960] Mark: mark all reachable objects. Sweep: if object is unmarked, it is garbage, so add to free list. Memory cost: Uses 1 extra mark bit per object, plus DFS stack. 14
15 Reachability Goal. Find all vertices reachable from s along a directed path. s 15
16 Reachability Goal. Find all vertices reachable from s along a directed path. s 16
17 Digraph-processing challenge 1: Problem: Mark all vertices reachable from a given vertex. How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert 4) intractable 5) no one knows
18 Depth-first search in digraphs Same method as for undirected graphs Every undirected graph is a digraph DFS is a digraph algorithm happens to have edges in both directions DFS (to visit a vertex v) Mark v as visited. Visit all unmarked vertices w adjacent to v. recursive 18
19 Depth-first search (single-source reachability) Identical to undirected version (substitute Digraph for Graph). public class DFSearcher private boolean[] marked; public DFSearcher(Digraph G, int s) marked = new boolean[g.v()]; dfs(g, s); private void dfs(digraph G, int v) marked[v] = true; for (int w : G.adj(v)) if (!marked[w]) dfs(g, w); true if connected to s constructor marks vertices connected to s recursive DFS does the work public boolean isreachable(int v) return marked[v]; client can ask whether any vertex is connected to s 19
20 Depth-first search (DFS) DFS enables direct solution of simple digraph problems. Reachability. Cycle detection Topological sort Transitive closure. Is there a path from s to t? Basis for solving difficult digraph problems. Directed Euler path. Strong connected components. stay tuned 20
21 Breadth-first search in digraphs Same method as for undirected graphs Every undirected graph is a digraph BFS is a digraph algorithm happens to have edges in both directions BFS (from source vertex s) Put s onto a FIFO queue. Repeat until the queue is empty: remove the least recently added vertex v add each of v's unvisited neighbors to the queue and mark them as visited. Visits vertices in increasing distance from s 21
22 Digraph BFS application: Web Crawler The internet is a digraph Goal. Crawl Internet, starting from some root website. Solution. BFS with implicit graph. BFS. Start at some root website ( say Dequeue the next website Maintain a Queue of websites to explore. Maintain a SET of discovered websites. and enqueue websites to which it links (provided you haven't done so before) subtle Page ranks point: with histogram think for a larger about example it! Q. Why not use DFS? A. Internet is not fixed (some pages generate new ones when visited)
23 Web crawler: BFS-based Java implementation Queue<String> q = new Queue<String>(); SET<String> visited = new SET<String>(); String s = " q.enqueue(s); visited.add(s); while (!q.isempty()) String v = q.dequeue(); System.out.println(v); In in = new In(v); String input = in.readall(); queue of sites to crawl set of visited sites start crawling from s read in raw html for next site in queue String regexp = " Pattern pattern = Pattern.compile(regexp); Matcher matcher = pattern.matcher(input); while (matcher.find()) String w = matcher.group(); if (!visited.contains(w)) visited.add(w); q.enqueue(w); use regular expression to find all URLs in site if unvisited, mark as visited and put on queue 23
24 digraph search transitive closure topological sort strong components 24
25 Graph-processing challenge (revisited) Problem: Is there a path from s to t? Goals: linear ~(V + E) preprocessing time constant query time 0 How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert ) intractable 5) no one knows 6) impossible 25
26 Digraph-processing challenge 2 Problem: Is there a directed path from s to t? Goals: linear ~(V + E) preprocessing time constant query time How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert 4) intractable 5) no one knows 6) impossible
27 Transitive Closure The transitive closure of G has an directed edge from v to w if there is a directed path from v to w in G graph is usually sparse G Transitive closure of G TC is usually dense so adjacency matrix representation is OK 27
28 Digraph-processing challenge 2 (revised) Problem: Is there a directed path from s to t? Goals: ~V 2 preprocessing time constant query time How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert 4) intractable 5) no one knows 6) impossible
29 Digraph-processing challenge 2 (revised again) Problem: Is there a directed path from s to t? Goals: ~VE preprocessing time (~V 3 for dense digraphs) ~V 2 space constant query time How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert 4) intractable 5) no one knows 6) impossible
30 Transitive closure: Java implementation Use an array of DFSearcher objects, one for each row of transitive closure public class TransitiveClosure private DFSearcher[] tc; public TransitiveClosure(Digraph G) tc = new DFSearcher[G.V()]; for (int v = 0; v < G.V(); v++) tc[v] = new DFSearcher(G, v); public class DFSearcher private boolean[] marked; public DFSearcher(Digraph G, int s) marked = new boolean[g.v()]; dfs(g, s); private void dfs(digraph G, int v) marked[v] = true; for (int w : G.adj(v)) if (!marked[w]) dfs(g, w); public boolean isreachable(int v) return marked[v]; public boolean reachable(int v, int w) return tc[v].isreachable(w); is there a directed path from v to w? 30
31 digraph search transitive closure topological sort strong components 31
32 Digraph application: Scheduling Scheduling. Given a set of tasks to be completed with precedence constraints, in what order should we schedule the tasks? Graph model. Create a vertex v for each task. Create an edge v w if task v must precede task w. Schedule tasks in topological order. tasks precedence constraints 0. read programming assignment 1. download files 2. write code 3. attend precept 12. sleep feasible schedule 32
33 Topological Sort DAG. Directed acyclic graph. Topological sort. Redraw DAG so all edges point left to right. Observation. Not possible if graph has a directed cycle. 33
34 Digraph-processing challenge 3 Problem: Check that the digraph is a DAG. If it is a DAG, do a topological sort. Goals: linear ~(V + E) preprocessing time provide client with vertex iterator for topological order How difficult? 1) any CS126 student could do it 2) need to be a typical diligent CS226 student 3) hire an expert 4) intractable 5) no one knows 6) impossible
35 Topological sort in a DAG: Java implementation public class TopologicalSorter private int count; private boolean[] marked; private int[] ts; standard DFS with 5 extra lines of code public TopologicalSorter(Digraph G) marked = new boolean[g.v()]; ts = new int[g.v()]; count = G.V(); for (int v = 0; v < G.V(); v++) if (!marked[v]) tsort(g, v); private void tsort(digraph G, int v) marked[v] = true; for (int w : G.adj(v)) if (!marked[w]) tsort(g, w); ts[--count] = v; add iterator that returns ts[0], ts[1], ts[2]... Seems easy? Missed by experts for a few decades 35
36 Topological sort of a dag: trace visit means call tsort() and leave means return from tsort() marked[] ts[] visit 0: visit 1: visit 4: leave 4: leave 1: visit 2: leave 2: visit 5: check 2: leave 5: leave 0: check 1: check 2: visit 3: check 2: check 4: check 5: visit 6: leave 6: leave 3: check 4: check 5: check 6: adj SETs : : 4 2: 3: : 5: 2 6:
37 Topological sort in a DAG: correctness proof Invariant: tsort(g, v) visits all vertices reachable from v with a directed path Proof by induction: w marked: vertices reachable from w are already visited w not marked: call tsort(g, w) to visit the vertices reachable from w Therefore, algorithm is correct in placing v before all vertices visited during call to tsort(g, v) just before returning. public class TopologicalSorter private int count; private boolean[] marked; private int[] ts; public TopologicalSorter(Digraph G) marked = new boolean[g.v()]; ts = new int[g.v()]; count = G.V(); for (int v = 0; v < G.V(); v++) if (!marked[v]) tsort(g, v); private void tsort(digraph G, int v) marked[v] = true; for (int w : G.adj(v)) if (!marked[w]) tsort(g, w); ts[--count] = v; Q. How to tell whether the digraph has a cycle (is not a DAG)? A. Use TopologicalSorter (exercise) 37
38 Topological sort applications. Causalities. Compilation units. Class inheritance. Course prerequisites. Deadlocking detection. Temporal dependencies. Pipeline of computing jobs. Check for symbolic link loop. Evaluate formula in spreadsheet. Program Evaluation and Review Technique / Critical Path Method 38
39 Topological sort application (weighted DAG) Precedence scheduling Task v takes time[v] units of time. Can work on jobs in parallel. Precedence constraints: must finish task v before beginning task w. Goal: finish each task as soon as possible Example: D 6 E 5 F 3 index task time prereq A begin 0 - B framing 4 A C roofing 2 B D siding 6 B E windows 5 D F plumbing 3 D G electricity 4 C, E H paint 6 C, E I finish 0 F, H A B G H I 0 4 C vertices labelled A-I in topological order 39
40 Program Evaluation and Review Technique / Critical Path Method PERT/CPM algorithm. compute topological order of vertices. initialize fin[v] = 0 for all vertices v. consider vertices v in topologically sorted order. for each edge v w, set fin[w]= max(fin[w], fin[v] + time[w]) critical path F D E A B 6 G H I 0 4 C Critical path remember vertex that set value. work backwards from sink 40
41 digraph search transitive closure topological sort strong components 41
42 Strong connectivity in digraphs Analog to connectivity in undirected graphs In a Graph, u and v are connected when there is a path from u to v In a Digraph, u and v are strongly connected when there is a directed path from u to v and a directed path from v to u connected components (sets of mutually connected vertices) 4 strongly connected components (sets of mutually strongly connected vertices) Connectivity table (easy to compute with DFS) cc Strong connectivity table (how to compute?) sc public int connected(int v, int w) return cc[v] == cc[w]; public int connected(int v, int w) return cc[v] == cc[w]; constant-time client connectivity query constant-time client strong connectivity query 42
43 Digraph-processing challenge 4 Problem: Is there a directed cycle containing s and t? Equivalent: Are there directed paths from s to t and from t to s? Equivalent: Are s and t strongly connected? Goals: linear (V + E) preprocessing time (like for undirected graphs) constant query time How difficult? 1) any COS126 student could do it 2) need to be a typical diligent COS226 student 3) hire an expert 4) intractable 5) no one knows 6) impossible 43
44 Typical strong components applications Ecological food web Software module dependency digraphs Firefox Internet explorer Strong component: subset with common energy flow source in kernel DAG: needs outside energy? sink in kernel DAG: heading for growth? Strong component: subset of mutually interacting modules approach 1: package strong components together approach 2: use to improve design! 44
45 Strong components algorithms: brief history 1960s: Core OR problem widely studied some practical algorithms complexity not understood 1972: Linear-time DFS algorithm (Tarjan) classic algorithm level of difficulty: CS226++ demonstrated broad applicability and importance of DFS 1980s: Easy two-pass linear-time algorithm (Kosaraju) forgot notes for teaching algorithms class developed algorithm in order to teach it! later found in Russian scientific literature (1972) 1990s: More easy linear-time algorithms (Gabow, Mehlhorn) Gabow: fixed old OR algorithm Mehlhorn: needed one-pass algorithm for LEDA 45
46 Kosaraju's algorithm Simple (but mysterious) algorithm for computing strong components Run DFS on GR and compute postorder. Run DFS on G, considering vertices in reverse postorder [has to be seen to be believed: follow example in book] G G R Theorem. Trees in second DFS are strong components. (!) Proof. [stay tuned in COS 423] 46
47 Digraph-processing summary: Algorithms of the day Single-source reachability DFS transitive closure DFS from each vertex topological sort (DAG) DFS strong components Kosaraju DFS (twice) 47
Analysis of Algorithms, I
Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications
Social Media Mining. Graph Essentials
Graph Essentials Graph Basics Measures Graph and Essentials Metrics 2 2 Nodes and Edges A network is a graph nodes, actors, or vertices (plural of vertex) Connections, edges or ties Edge Node Measures
Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit
Data Structures Page 1 of 24 A.1. Arrays (Vectors) n-element vector start address + ielementsize 0 +1 +2 +3 +4... +n-1 start address continuous memory block static, if size is known at compile time dynamic,
Union-Find Algorithms. network connectivity quick find quick union improvements applications
Union-Find Algorithms network connectivity quick find quick union improvements applications 1 Subtext of today s lecture (and this course) Steps to developing a usable algorithm. Define the problem. Find
Practical Graph Mining with R. 5. Link Analysis
Practical Graph Mining with R 5. Link Analysis Outline Link Analysis Concepts Metrics for Analyzing Networks PageRank HITS Link Prediction 2 Link Analysis Concepts Link A relationship between two entities
Data Structures and Algorithms Written Examination
Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where
Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits
Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique
V. Adamchik 1. Graph Theory. Victor Adamchik. Fall of 2005
V. Adamchik 1 Graph Theory Victor Adamchik Fall of 2005 Plan 1. Basic Vocabulary 2. Regular graph 3. Connectivity 4. Representing Graphs Introduction A.Aho and J.Ulman acknowledge that Fundamentally, computer
Minimum Spanning Trees
Minimum Spanning Trees weighted graph API cycles and cuts Kruskal s algorithm Prim s algorithm advanced topics References: Algorithms in Java, Chapter 20 http://www.cs.princeton.edu/introalgsds/54mst 1
Asking Hard Graph Questions. Paul Burkhardt. February 3, 2014
Beyond Watson: Predictive Analytics and Big Data U.S. National Security Agency Research Directorate - R6 Technical Report February 3, 2014 300 years before Watson there was Euler! The first (Jeopardy!)
Computing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,
The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints
The PageRank Citation Ranking: Bring Order to the Web
The PageRank Citation Ranking: Bring Order to the Web presented by: Xiaoxi Pang 25.Nov 2010 1 / 20 Outline Introduction A ranking for every page on the Web Implementation Convergence Properties Personalized
CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards
CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards Course Title: TeenCoder: Java Programming Course ISBN: 978 0 9887070 2 3 Course Year: 2015 Note: Citation(s) listed may represent
DATA ANALYSIS II. Matrix Algorithms
DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where
CompSci-61B, Data Structures Final Exam
Your Name: CompSci-61B, Data Structures Final Exam Your 8-digit Student ID: Your CS61B Class Account Login: This is a final test for mastery of the material covered in our labs, lectures, and readings.
Part 2: Community Detection
Chapter 8: Graph Data Part 2: Community Detection Based on Leskovec, Rajaraman, Ullman 2014: Mining of Massive Datasets Big Data Management and Analytics Outline Community Detection - Social networks -
Binary Heap Algorithms
CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks [email protected] 2005 2009 Glenn G. Chappell
Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs
CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like
IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*
IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* Rakesh Nagi Department of Industrial Engineering University at Buffalo (SUNY) *Lecture notes from Network Flows by Ahuja, Magnanti
6.852: Distributed Algorithms Fall, 2009. Class 2
.8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election
An Introduction to APGL
An Introduction to APGL Charanpal Dhanjal February 2012 Abstract Another Python Graph Library (APGL) is a graph library written using pure Python, NumPy and SciPy. Users new to the library can gain an
Exam study sheet for CS2711. List of topics
Exam study sheet for CS2711 Here is the list of topics you need to know for the final exam. For each data structure listed below, make sure you can do the following: 1. Give an example of this data structure
Mining Social Network Graphs
Mining Social Network Graphs Debapriyo Majumdar Data Mining Fall 2014 Indian Statistical Institute Kolkata November 13, 17, 2014 Social Network No introduc+on required Really? We s7ll need to understand
Persistent Data Structures
6.854 Advanced Algorithms Lecture 2: September 9, 2005 Scribes: Sommer Gentry, Eddie Kohler Lecturer: David Karger Persistent Data Structures 2.1 Introduction and motivation So far, we ve seen only ephemeral
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential
Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition
Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating
Big Data Technology Motivating NoSQL Databases: Computing Page Importance Metrics at Crawl Time
Big Data Technology Motivating NoSQL Databases: Computing Page Importance Metrics at Crawl Time Edward Bortnikov & Ronny Lempel Yahoo! Labs, Haifa Class Outline Link-based page importance measures Why
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.
1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated
Network (Tree) Topology Inference Based on Prüfer Sequence
Network (Tree) Topology Inference Based on Prüfer Sequence C. Vanniarajan and Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology Madras Chennai 600036 [email protected],
Assessment Plan for CS and CIS Degree Programs Computer Science Dept. Texas A&M University - Commerce
Assessment Plan for CS and CIS Degree Programs Computer Science Dept. Texas A&M University - Commerce Program Objective #1 (PO1):Students will be able to demonstrate a broad knowledge of Computer Science
Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs
Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs Kousha Etessami U. of Edinburgh, UK Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 6) 1 / 13 Overview Graphs and Graph
Java Software Structures
INTERNATIONAL EDITION Java Software Structures Designing and Using Data Structures FOURTH EDITION John Lewis Joseph Chase This page is intentionally left blank. Java Software Structures,International Edition
Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013
Dynamic programming Doctoral course Optimization on graphs - Lecture.1 Giovanni Righini January 1 th, 201 Implicit enumeration Combinatorial optimization problems are in general NP-hard and we usually
Simplified External memory Algorithms for Planar DAGs. July 2004
Simplified External Memory Algorithms for Planar DAGs Lars Arge Duke University Laura Toma Bowdoin College July 2004 Graph Problems Graph G = (V, E) with V vertices and E edges DAG: directed acyclic graph
A Review And Evaluations Of Shortest Path Algorithms
A Review And Evaluations Of Shortest Path Algorithms Kairanbay Magzhan, Hajar Mat Jani Abstract: Nowadays, in computer networks, the routing is based on the shortest path problem. This will help in minimizing
Data Structure [Question Bank]
Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:
Load balancing Static Load Balancing
Chapter 7 Load Balancing and Termination Detection Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination detection
Why? A central concept in Computer Science. Algorithms are ubiquitous.
Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online
So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)
Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #39 Search Engines and Web Crawler :: Part 2 So today we
Warshall s Algorithm: Transitive Closure
CS 0 Theory of Algorithms / CS 68 Algorithms in Bioinformaticsi Dynamic Programming Part II. Warshall s Algorithm: Transitive Closure Computes the transitive closure of a relation (Alternatively: all paths
CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.
Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure
DATA STRUCTURES USING C
DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give
Incremental Routing Algorithms For Dynamic Transportation Networks
UCGE Reports Number 20238 Department of Geomatics Engineering Incremental Routing Algorithms For Dynamic Transportation Networks (URL: http://www.geomatics.ucalgary.ca/research/publications/gradtheses.html)
Problem Set 7 Solutions
8 8 Introduction to Algorithms May 7, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 25 Problem Set 7 Solutions This problem set is due in
5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.
1. The advantage of.. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. [A] Lists [B] Linked Lists [A] Trees [A] Queues 2. The
Cloud Computing. Lectures 10 and 11 Map Reduce: System Perspective 2014-2015
Cloud Computing Lectures 10 and 11 Map Reduce: System Perspective 2014-2015 1 MapReduce in More Detail 2 Master (i) Execution is controlled by the master process: Input data are split into 64MB blocks.
Big O and Limits Abstract Data Types Data Structure Grand Tour. http://gcc.gnu.org/onlinedocs/libstdc++/images/pbds_different_underlying_dss_1.
Big O and Limits Abstract Data Types Data Structure Grand Tour http://gcc.gnu.org/onlinedocs/libstdc++/images/pbds_different_underlying_dss_1.png Consider the limit lim n f ( n) g ( n ) What does it
SPANNING CACTI FOR STRUCTURALLY CONTROLLABLE NETWORKS NGO THI TU ANH NATIONAL UNIVERSITY OF SINGAPORE
SPANNING CACTI FOR STRUCTURALLY CONTROLLABLE NETWORKS NGO THI TU ANH NATIONAL UNIVERSITY OF SINGAPORE 2012 SPANNING CACTI FOR STRUCTURALLY CONTROLLABLE NETWORKS NGO THI TU ANH (M.Sc., SFU, Russia) A THESIS
Any two nodes which are connected by an edge in a graph are called adjacent node.
. iscuss following. Graph graph G consist of a non empty set V called the set of nodes (points, vertices) of the graph, a set which is the set of edges and a mapping from the set of edges to a set of pairs
Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902
Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902 http://www.ms.uky.edu/~mschreffler Different Graphs, Similar Properties
CSE 4351/5351 Notes 7: Task Scheduling & Load Balancing
CSE / Notes : Task Scheduling & Load Balancing Task Scheduling A task is a (sequential) activity that uses a set of inputs to produce a set of outputs. A task (precedence) graph is an acyclic, directed
Parallelization: Binary Tree Traversal
By Aaron Weeden and Patrick Royal Shodor Education Foundation, Inc. August 2012 Introduction: According to Moore s law, the number of transistors on a computer chip doubles roughly every two years. First
Load Balancing and Termination Detection
Chapter 7 Load Balancing and Termination Detection 1 Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination detection
Questions 1 through 25 are worth 2 points each. Choose one best answer for each.
Questions 1 through 25 are worth 2 points each. Choose one best answer for each. 1. For the singly linked list implementation of the queue, where are the enqueues and dequeues performed? c a. Enqueue in
Vector storage and access; algorithms in GIS. This is lecture 6
Vector storage and access; algorithms in GIS This is lecture 6 Vector data storage and access Vectors are built from points, line and areas. (x,y) Surface: (x,y,z) Vector data access Access to vector
Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C
Tutorial#1 Q 1:- Explain the terms data, elementary item, entity, primary key, domain, attribute and information? Also give examples in support of your answer? Q 2:- What is a Data Type? Differentiate
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm
Cpt S 223. School of EECS, WSU
The Shortest Path Problem 1 Shortest-Path Algorithms Find the shortest path from point A to point B Shortest in time, distance, cost, Numerous applications Map navigation Flight itineraries Circuit wiring
Approximation Algorithms
Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms
Sequential Data Structures
Sequential Data Structures In this lecture we introduce the basic data structures for storing sequences of objects. These data structures are based on arrays and linked lists, which you met in first year
Graph Theory and Complex Networks: An Introduction. Chapter 06: Network analysis
Graph Theory and Complex Networks: An Introduction Maarten van Steen VU Amsterdam, Dept. Computer Science Room R4.0, [email protected] Chapter 06: Network analysis Version: April 8, 04 / 3 Contents Chapter
5.1 Bipartite Matching
CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson
Small Maximal Independent Sets and Faster Exact Graph Coloring
Small Maximal Independent Sets and Faster Exact Graph Coloring David Eppstein Univ. of California, Irvine Dept. of Information and Computer Science The Exact Graph Coloring Problem: Given an undirected
1 Definitions. Supplementary Material for: Digraphs. Concept graphs
Supplementary Material for: van Rooij, I., Evans, P., Müller, M., Gedge, J. & Wareham, T. (2008). Identifying Sources of Intractability in Cognitive Models: An Illustration using Analogical Structure Mapping.
Enhancing the Ranking of a Web Page in the Ocean of Data
Database Systems Journal vol. IV, no. 3/2013 3 Enhancing the Ranking of a Web Page in the Ocean of Data Hitesh KUMAR SHARMA University of Petroleum and Energy Studies, India [email protected] In today
Glossary of Object Oriented Terms
Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction
Discrete Mathematics. Hans Cuypers. October 11, 2007
Hans Cuypers October 11, 2007 1 Contents 1. Relations 4 1.1. Binary relations................................ 4 1.2. Equivalence relations............................. 6 1.3. Relations and Directed Graphs.......................
2010-2011 Assessment for Master s Degree Program Fall 2010 - Spring 2011 Computer Science Dept. Texas A&M University - Commerce
2010-2011 Assessment for Master s Degree Program Fall 2010 - Spring 2011 Computer Science Dept. Texas A&M University - Commerce Program Objective #1 (PO1):Students will be able to demonstrate a broad knowledge
Static Load Balancing
Load Balancing Load Balancing Load balancing: distributing data and/or computations across multiple processes to maximize efficiency for a parallel program. Static load-balancing: the algorithm decides
OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION
OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION Sérgio Pequito, Stephen Kruzick, Soummya Kar, José M. F. Moura, A. Pedro Aguiar Department of Electrical and Computer Engineering
Data Structures. Chapter 8
Chapter 8 Data Structures Computer has to process lots and lots of data. To systematically process those data efficiently, those data are organized as a whole, appropriate for the application, called a
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY A PATH FOR HORIZING YOUR INNOVATIVE WORK A REVIEW ON THE USAGE OF OLD AND NEW DATA STRUCTURE ARRAYS, LINKED LIST, STACK,
CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions
CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly
A Fast Algorithm For Finding Hamilton Cycles
A Fast Algorithm For Finding Hamilton Cycles by Andrew Chalaturnyk A thesis presented to the University of Manitoba in partial fulfillment of the requirements for the degree of Masters of Science in Computer
Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:
CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm
Division of Mathematical Sciences
Division of Mathematical Sciences Chair: Mohammad Ladan, Ph.D. The Division of Mathematical Sciences at Haigazian University includes Computer Science and Mathematics. The Bachelor of Science (B.S.) degree
This exam contains 13 pages (including this cover page) and 18 questions. Check to see if any pages are missing.
Big Data Processing 2013-2014 Q2 April 7, 2014 (Resit) Lecturer: Claudia Hauff Time Limit: 180 Minutes Name: Answer the questions in the spaces provided on this exam. If you run out of room for an answer,
Systems and Algorithms for Big Data Analytics
Systems and Algorithms for Big Data Analytics YAN, Da Email: [email protected] My Research Graph Data Distributed Graph Processing Spatial Data Spatial Query Processing Uncertain Data Querying & Mining
Link Analysis. Chapter 5. 5.1 PageRank
Chapter 5 Link Analysis One of the biggest changes in our lives in the decade following the turn of the century was the availability of efficient and accurate Web search, through search engines such as
Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms
CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard [email protected] CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes
Lecture 2: Data Structures Steven Skiena. http://www.cs.sunysb.edu/ skiena
Lecture 2: Data Structures Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena String/Character I/O There are several approaches
This lecture. Abstract data types Stacks Queues. ADTs, Stacks, Queues 1. 2004 Goodrich, Tamassia
This lecture Abstract data types Stacks Queues ADTs, Stacks, Queues 1 Abstract Data Types (ADTs) An abstract data type (ADT) is an abstraction of a data structure An ADT specifies: Data stored Operations
CHAPTER 4 ESSENTIAL DATA STRUCTRURES
CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex
4.2 Sorting and Searching
Sequential Search: Java Implementation 4.2 Sorting and Searching Scan through array, looking for key. search hit: return array index search miss: return -1 public static int search(string key, String[]
The Open University s repository of research publications and other research outputs
Open Research Online The Open University s repository of research publications and other research outputs The degree-diameter problem for circulant graphs of degree 8 and 9 Journal Article How to cite:
Fundamentals of algorithms
CHAPTER Fundamentals of algorithms 4 Chung-Yang (Ric) Huang National Taiwan University, Taipei, Taiwan Chao-Yue Lai National Taiwan University, Taipei, Taiwan Kwang-Ting (Tim) Cheng University of California,
7.1 Our Current Model
Chapter 7 The Stack In this chapter we examine what is arguably the most important abstract data type in computer science, the stack. We will see that the stack ADT and its implementation are very simple.
1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++
Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The
Lecture 17 : Equivalence and Order Relations DRAFT
CS/Math 240: Introduction to Discrete Mathematics 3/31/2011 Lecture 17 : Equivalence and Order Relations Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last lecture we introduced the notion
On the k-path cover problem for cacti
On the k-path cover problem for cacti Zemin Jin and Xueliang Li Center for Combinatorics and LPMC Nankai University Tianjin 300071, P.R. China [email protected], [email protected] Abstract In this paper we
Yousef Saad University of Minnesota Computer Science and Engineering. CRM Montreal - April 30, 2008
A tutorial on: Iterative methods for Sparse Matrix Problems Yousef Saad University of Minnesota Computer Science and Engineering CRM Montreal - April 30, 2008 Outline Part 1 Sparse matrices and sparsity
B AB 5 C AC 3 D ABGED 9 E ABGE 7 F ABGEF 8 G ABG 6 A BEDA 3 C BC 1 D BCD 2 E BE 1 F BEF 2 G BG 1
p.9 9.5 a. Find the shortest path from A to all other vertices for the graph in Figure 9.8. b. Find the shortest unweighted path from B to all other vertices for the graph in Figure 9.8. A 5 B C 7 7 6
5. Binary objects labeling
Image Processing - Laboratory 5: Binary objects labeling 1 5. Binary objects labeling 5.1. Introduction In this laboratory an object labeling algorithm which allows you to label distinct objects from a
The LCA Problem Revisited
The LA Problem Revisited Michael A. Bender Martín Farach-olton SUNY Stony Brook Rutgers University May 16, 2000 Abstract We present a very simple algorithm for the Least ommon Ancestor problem. We thus
