Certifying Algorithms [MNS11]R.M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer. Certifying algorithms. Computer Science Review, 5(2), 119-161, 2011.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Certifying algorithms Algorithms and Networks. Certifying algorithms What is it? Examples: –Euler tour –Bipartite graphs –Flow –Planarity Certifying algorithms2.
NP-Hard Nattee Niparnan.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Minimum Spanning Trees Definition Two properties of MST’s Prim and Kruskal’s Algorithm –Proofs of correctness Boruvka’s algorithm Verifying an MST Randomized.
Breadth-First Search of Graphs Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
 Graph Graph  Types of Graphs Types of Graphs  Data Structures to Store Graphs Data Structures to Store Graphs  Graph Definitions Graph Definitions.
Lectures on Network Flows
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Dynamic Sets and Data Structures Over the course of an algorithm’s execution, an algorithm may maintain a dynamic set of objects The algorithm will perform.
Coloring Algorithms and Networks. Coloring2 Graph coloring Vertex coloring: –Function f: V  C, such that for all {v,w}  E: f(v)  f(w) Chromatic number.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Fall 2014 Doug James Lecture 17: Graphs.
Dijkstra’s Algorithm Slide Courtesy: Uwash, UT 1.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Dynamic Sets and Data Structures Over the course of an algorithm’s execution, an algorithm may maintain a dynamic set of objects The algorithm will perform.
Important Problem Types and Fundamental Data Structures
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Spring 2015 Lecture 11: Minimum Spanning Trees
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
Flow Algorithms Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 9, Lecture 2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
ALITHEIA: Towards Practical Verifiable Graph Processing Yupeng Zhang, Charalampos Papamanthou and Jonathan Katz University of Maryland.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Trees.
Graph Search Applications, Minimum Spanning Tree
Shortest Paths and Minimum Spanning Trees
Computing Connected Components on Parallel Computers
Lectures on Network Flows
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Chapter 5. Optimal Matchings
CSE 421: Introduction to Algorithms
Minimum Spanning Tree.
Connected Components Minimum Spanning Tree
Graphs & Graph Algorithms 2
Greedy Algorithms / Dijkstra’s Algorithm Yin Tat Lee
Graph.
Graphs Chapter 13.
Richard Anderson Lecture 25 NP-Completeness
Elementary graph algorithms Chapter 22
CSE 373 Data Structures and Algorithms
Chapter 22: Elementary Graph Algorithms I
Minimum Spanning Tree Algorithms
Shortest Paths and Minimum Spanning Trees
Richard Anderson Autumn 2016 Lecture 5
Slide Courtesy: Uwash, UT
Chapter 14 Graphs © 2006 Pearson Addison-Wesley. All rights reserved.
CSE 373: Data Structures and Algorithms
Slide Courtesy: Uwash, UT
Graph Algorithms: Shortest Path
CSE 417: Algorithms and Computational Complexity
GRAPHS Lecture 17 CS2110 Spring 2018.
Elementary graph algorithms Chapter 22
CSE 373: Data Structures and Algorithms
Important Problem Types and Fundamental Data Structures
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Richard Anderson Winter 2019 Lecture 6
Richard Anderson Lecture 5 Graph Theory
CSE 373: Data Structures and Algorithms
Richard Anderson Winter 2019 Lecture 5
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Drawing a graph
Presentation transcript:

Certifying Algorithms [MNS11]R.M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer. Certifying algorithms. Computer Science Review, 5(2), , 2011.

Correctnesss of algorithms ?  Formal proof of algorithm correctness – only simple problems ? – implementation  algorithm  Compare output of two algorithms – one algorithm often simple and slow (only small input)  Assertions / exceptions  Unit testing – systematic testing, random input

Certifying Algorithm  Algorithms output proof w of correctnes or illegal input  Strongly certifying  halts on all input; identifies illegal input  Certifying  halts on all input; illegal input or correct output  Weakly certifying  halts on valid input; if halts, correct out  Motivation: Ensure correctnes of algorithms in the Library of Efficient Data Types and Algorithms

Sorting ?  Input: Unsorted array  Output: Input elements in sorted order  Checker: – Verify output sorted – Verify output = input elements

Greatest Common Divisor - GCD  Input: Positive integers a and b  Output: g = gcd(a, b)  Certificate: – Integers x, y: where g = ax + by  Checker: – Check g  a, g  b, and g = ax + by – Sufficient by [MMNP11, Lemma 1]

Bipartite Graph ?  Input: Undirected Graph G=(V,E)  Output: Boolean, is the graph bipartite  Certificate: – True: Partition of the vertices, V = V 1  V 2 – False: Odd length cycle  Checker: – Verify partition or cycle

Connected Components ?  Input: Undirected graph G = (V, E)  Output: Partition of V into the c.c.  Certificate: – Each vertex labeled (i, j), where i=component number, j=the node’s number in the component, such that all nodes except one in a c.c. have a neighbor with smaller j (e.g., BFS numbering)  Checker: – Edges connect identical i – Mark non-root nodes (j larger than a neighbor) – Check roots different labels

Shortest Path s  t ?  Input: Directed weighted graph G = (V, E), s,t  V  Output: Shortest distance s  t  Certificate: – Distance vector D, with distances from s to all nodes – Shortest path tree  Checker: – Check shortest path tree implies D – Check that no edge can improve any distance

Planarity Graph ?  Input: An undirected graph G  Output: Boolean, is G planar – can G be drawn without edges intersecting ?  Certificate: – Yes = (Combinatorial) Embedding (twin edges, face information) – No = K 3,3 og K 5 (Kuratowski subgraphs)  Checker: – Yes: Check if n+f =m+2, n=#nodes, m=#edges, f=#boundary cycles (sufficient by [MMNS11, Lemma 3]) – No: Verify Kuratowski subgraphs

Maximum Flow ?  Input: Flow network G, with capacity constraints c  Output: Value of maximum flow  Certificate: – Flow along each edge – Minimum cut, i.e. partition of the vertices  Checker: – Check if valid flow – Find capacity of cut – Check if cut capacity is equal to value of flow

Dynamic Dictionary  Operations: Insert, Delete, Search,...  Checker / Monitor: – Checker maintains a doubly-linked list of handles into dictionary  Checker identifies wrong queries immediately

Priority Queue  Operations: Insert, DeleteMin...  Checker / Monitor: (see figure) – check element against lower bound on deletion  Checker identifies wrong queries delayed priority elements with no lower bound (no DeleteMin since insertion) insertion time elements currently in priority queue union find data structure lower bound