CS 4407 Algorithms Greedy Algorithms and Minimum Spanning Trees

Similar documents
Minimum Spanning Tree Union-Find Data Structure. Feb 28, 2018 CSCI211 - Sprenkle. Comcast wants to lay cable in a neighborhood. Neighborhood Layout

Estimating the Margin of Victory for Instant-Runoff Voting

Prim's MST Algorithm with step-by-step execution

Political Districting for Elections to the German Bundestag: An Optimization-Based Multi-Stage Heuristic Respecting Administrative Boundaries

Designing police patrol districts on street network

Kruskal's MST Algorithm with step-by-step execution

Coalitional Game Theory

Approval Voting Theory with Multiple Levels of Approval

The Australian Society for Operations Research

Subreddit Recommendations within Reddit Communities

Estimating the Margin of Victory for Instant-Runoff Voting*

Spatial Chaining Methods for International Comparisons of Prices and Real Expenditures D.S. Prasada Rao The University of Queensland

Networked Games: Coloring, Consensus and Voting. Prof. Michael Kearns Networked Life NETS 112 Fall 2013

17.1 Introduction. Giulia Massini and Massimo Buscema

HASHGRAPH CONSENSUS: DETAILED EXAMPLES

A MINIMUM DISTANCE AND THE GENERALISED EKS APPROACHES TO MULTILATERAL COMPARISONS OF PRICES AND REAL INCOMES

STUDY GUIDE FOR TEST 2

Simple methods for single winner elections

Computational challenges in analyzing and moderating online social discussions

Hat problem on a graph

CSCI211: Intro Objectives

The Effectiveness of Receipt-Based Attacks on ThreeBallot

How hard is it to control sequential elections via the agenda?

Constraint satisfaction problems. Lirong Xia

Hyo-Shin Kwon & Yi-Yi Chen

Title: Adverserial Search AIMA: Chapter 5 (Sections 5.1, 5.2 and 5.3)

Voting and Complexity

CS269I: Incentives in Computer Science Lecture #4: Voting, Machine Learning, and Participatory Democracy

Voting Methods

Do two parties represent the US? Clustering analysis of US public ideology survey

Economics 470 Some Notes on Simple Alternatives to Majority Rule

An example of public goods

Cyber-Physical Systems Scheduling

Introduction to Computational Game Theory CMPT 882. Simon Fraser University. Oliver Schulte. Decision Making Under Uncertainty

On the Complexity of Voting Manipulation under Randomized Tie-Breaking

(67686) Mathematical Foundations of AI June 18, Lecture 6

Voting-Based Group Formation

Connecting Voting Theory and Graph Theory

Tengyu Ma Facebook AI Research. Based on joint work with Yuanzhi Li (Princeton) and Hongyang Zhang (Stanford)

Estimating the Margin of Victory for an IRV Election Part 1 by David Cary November 6, 2010

A Network Theory of Military Alliances

Processes. Criteria for Comparing Scheduling Algorithms

Section Voting Methods. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Randomized Pursuit-Evasion in Graphs

arxiv: v1 [cs.gt] 11 Jul 2018

Patterns in Congressional Earmarks

Congressional samples Juho Lamminmäki

CSRS Artist-in-Residence Fellowship

Comparison Sorts. EECS 2011 Prof. J. Elder - 1 -

Quant 101 Learn2Quant HK, 14 September Vinesh Jha CEO, ExtractAlpha

Politics is the subset of human behavior that involves the use of power or influence.

Predicting Information Diffusion Initiated from Multiple Sources in Online Social Networks

Randomized Pursuit-Evasion in Graphs

The Political Economy of Trade Policy

Strategy in Law and Business Problem Set 1 February 14, Find the Nash equilibria for the following Games:

Bribery in voting with CP-nets

JUDGE, JURY AND CLASSIFIER

Section Voting Methods. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Economics 320F An Economic Analysis of Law Midterm Exam Suggested Answers

Computational Social Choice: Spring 2017

NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Case Study: Border Protection

The Constitution. Name: The Law of the Land. What Does Our Constitution Look Like?

autonomous agents Onn Shehory Sarit Kraus fshechory, Abstract

Cloning in Elections 1

Aggregating Dependency Graphs into Voting Agendas in Multi-Issue Elections

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

CSE 308, Section 2. Semester Project Discussion. Session Objectives

Section Voting Methods. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Lab 3: Logistic regression models

Random Forests. Gradient Boosting. and. Bagging and Boosting

Adapting the Social Network to Affect Elections

A comparative analysis of subreddit recommenders for Reddit

Wind power integration and consumer behavior: a complementarity approach

arxiv: v2 [math.ho] 12 Oct 2018

Game Theory. Jiang, Bo ( 江波 )

Red Oak Strategic Presidential Poll

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :51 PM

Fairness Criteria. Review: Election Methods

5. Markets and the Environment

The perception of corruption in health: AutoCM methods for an international comparison

A New Method of the Single Transferable Vote and its Axiomatic Justification

The Constitution. Name: The Law of the Land. What Does Our Constitution Look Like? The Constitution s Table of Contents

A constraint based dependancy parser for Sanskrit

16. How to Structure Large Models and Programs with Graph Structurings

An Integer Linear Programming Approach for Coalitional Weighted Manipulation under Scoring Rules

Graph Structurings. 16. How to Structure Large Models - Obligatory Reading. Ø T. Fischer, Jörg Niere, L. Torunski, and Albert Zündorf, 'Story

Definition: Institution public system of rules which defines offices and positions with their rights and duties, powers and immunities p.

Computational social choice Combinatorial voting. Lirong Xia

The Constitution. Name: The Law of the Land. What Does Our Constitution Look Like?

Random tie-breaking in STV

Evaluation of Election Outcomes under Uncertainty

Minnehaha County Election Review Committee

Unit 03. Ngo Quy Nham Foreign Trade University

PLS 540 Environmental Policy and Management Mark T. Imperial. Topic: The Policy Process

Social Choice. CSC304 Lecture 21 November 28, Allan Borodin Adapted from Craig Boutilier s slides

Computational aspects of voting: a literature survey

Jörg Rothe. Editor. Economics and Computation. An Introduction to Algorithmic Game. Theory, Computational Social Choice, and Fair Division

Parameterized Control Complexity in Bucklin Voting and in Fallback Voting 1

The Complexity of Losing Voters

Transcription:

CS 4407 Algorithms Greedy Algorithms and Minimum Spanning Trees Prof. Gregory Provan Department of Computer Science University College Cork 1

Sample MST 6 5 4 9 14 10 2 3 8 15

Greedy Algorithms When are greedy algorithms optimal? Must satisfy the optimal substructure property Optimal sub-problem must participate in optimal problem

What makes a greedy algorithm? Feasible Has to satisfy the problem s constraints Locally Optimal The greedy part Has to make the best local choice among all feasible choices available on that step If this local choice results in a global optimum then the problem has optimal substructure Irrevocable Once a choice is made it can t be un-done on subsequent steps of the algorithm Simple examples: Playing chess by making best move without lookahead Giving fewest number of coins as change Simple and appealing, but don t always give the best solution

Definition Spanning Tree A spanning tree of a graph G is a tree (acyclic) that connects all the vertices of G once i.e. the tree spans every vertex in G A Minimum Spanning Tree (MST) is a spanning tree on a weighted graph that has the minimum total weight such that w(t) is minimum w( T ) = w( u, v) u, v T

Sample MST Which links to make this a MST? 6 5 4 9 14 10 2 3 8 15 Optimal substructure: A subtree of the MST must in turn be a MST of the nodes that it spans.

MST Claim Claim: Say that M is a MST If we remove any edge (u,v) from M then this results in two trees, T1 and T2. T1 is a MST of its subgraph while T2 is a MST of its subgraph. Then the MST of the entire graph is T1 + T2 + the smallest edge between T1 and T2 If some other edge was used, we wouldn t have the minimum spanning tree overall

Greedy Algorithm We can use a greedy algorithm to find the MST. Two common algorithms Kruskal Prim

Example: Kruskal s MST Algorithm Idea: Greedily construct the MST Go through the list of edges and make a forest that is a MST At each vertex, sort the edges Edges with smallest weights examined and possibly added to MST before edges with higher weights Edges added must be safe edges that do not ruin the tree property.

Activity-Selection Problem Problem: get your money s worth out of a carnival Buy a wristband that lets you onto any ride Lots of rides, each starting and ending at different times Your goal: ride as many rides as possible Another, alternative goal that we don t solve here: maximize time spent on rides Welcome to the activity selection problem

Formally: Activity-Selection Given a set S of n activities s i = start time of activity i f i = finish time of activity i Find max-size subset A of compatible activities 3 2 1 4 6 5 Assume (wlog) that f 1 f 2 f n

Activity Selection Problem Problem: Schedule an exclusive resource in competition with other entities. Formal Definition: Set S={1,2, n} of activities. Each activity has a start time s i and a finish time f j, where s i <f j. Activities i and j are compatible if they do not overlap. The activity selection problem select a maximum-size set of mutually compatible activities.

Greedy Choice Property Activity selection problem exhibits the greedy choice property: Locally optimal choice globally optimal sol n Theorem: if S is an activity selection problem sorted by finish time, then optimal solution A S such that {1} A Sketch of proof: if optimal solution B that does not contain {1}, can always replace first activity in B with {1} (Why?). Same number of activities, thus optimal.

Activity Selection: A Greedy Algorithm So actual algorithm is simple: Sort the activities by finish time Schedule the first activity Then schedule the next activity in sorted list which starts after previous activity finishes Repeat until no more activities Intuition is even more simple: Always pick the shortest ride available at the time

Greedy Activity Selection Just march through each activity by finish time and schedule it if possible:

Activity Selection Example Schedule job 1, then try rest: (end up with 1, 4, 8): T=1 T=2 T=3 T=4 T=5 T=6 T=7 T=8 T=9 T=10 T=11 T=12 T=13 1 1 1 1 Runtime?

Activity Selection: Optimal Substructure Let k be the minimum activity in A (i.e., the one with the earliest finish time). Then A - {k} is an optimal solution to S = {i S: s i f k } In words: once activity #1 is selected, the problem reduces to finding an optimal solution for activity-selection over activities in S compatible with #1 Proof: if we could find optimal solution B to S with B > A - {k}, Then B U {k} is compatible And B U {k} > A