Algorithms - CSE 202
Mathematical Preliminaries and Introductory Problems
Writing Style: We suggest the following steps in writing up your solutions, when they are applicable. For a detailed
writing style guidelines, please consult http:/cseweb.ucsd.edu/
CSE 202: Design and
Analysis of Algorithms
Lecture 10
Instructor: Kamalika Chaudhuri
Announcements
Midterm on Feb 14 in class
Material: Greedy, Divide and Conquer, Dynamic
Programming, Flows (including Capacity Scaling, but
not including Preow-push)
Last
CSE 202 Spring 2010
Solution Set 1 7 April 2010
Chapter 1, Problem 1: The statement is false, which is evident due to the following counterexample with 2 men (m1 and m2 ) and 2 women (w1 and w2 ). The preferences are as follows: m1 prefers w1 to w2 , m2 p
CSE 202 Homework 2 Solutions
1 Kleinberg & Tardos, problem 26, page 202. Time-varying Minimum Spanning Tree.
Connected graph G = (V, E ).
Each edge e E has a time-varying edge cost fe = ae t2 + be t + ce such that fe > 0 for all t.
Denote n = |V | and
Network Flows
1
Topics
Max-ow
Min-Cut
2
Exercises
3
Problems
Problem 1: Problem 26.1-9, page 650; (CLRS)
Professor Adam has two children who, unfortunately, dislike each other. The problem is so severe
that not only do they refuse to walk to school toge
Graph Algorithms
1
Topics
Graphs
Depth-rst search
Strongly connected components
Breadth-rst search
2
Exercises
Problem 1: Reverse of a graph (DPV)
The reverse of a directed graph G = (V, E) is another directed graph GR = (V, E R ), on the same
vertex
Introduction to Algorithms
Jon Kleinberg
Eva Tardos
Cornell University
Spring 2003
c Jon Kleinberg and Eva Tardos
2
Contents
1 Introduction
1.1 Introduction: The Stable Matching Problem
1.2 Computational Tractability . . . . . . . . .
1.3 Interlude: Two D
Series, Functions, and Recurrence Relations
1
Topics
1. Arithmetic and geometric series
2. Functions
3. Order notation
4. Recurrence relations
2
Exercises
Problem 1: Function growth
Suppose you have algorithms with the six running times listed below. Assu
Series, Functions, and Recurrence Relations
1
Topics
1. Arithmetic and geometric series
2. Functions
3. Order notation
4. Recurrence relations
2
Formulae you should know
You should remember these properties from previous calculus classes:
loga (b c) = lo
Scheduling Events to Minimize Rooms
Sample greedy solution write-up
Problem 1: Let E = cfw_(si , fi )|1 i n be a set of events to be scheduled in as few rooms as possible without conict
l
Assume that the sequence cfw_si is nondecreasing. If not, sort it
Greedy Method
1
Topics
Greedy algorithms
Minimum spanning trees
Human codes
2
Exercises
Problem 1: Removing edges (DPV)
Design a linear-time algorithm for the following task.
Input: A connected, undirected graph G.
Output: Is there an edge you can remo
Dynamic Programming
1
Problems
Problem 1: Shortest Path Counting
Find the number of the shortest paths from intersection A to intersection B in a city with perfectly
horizontal streets and vertical avenues shown in this map.
need gure here
Problem 2: Bloc
Design and Analysis of Algorithms Undergraduate Level
The collection of problems is designed to test the studentscompetency in the design and analysis
of algorithms at the undergraduate level. Solving these problems requires an understanding and
applicati
Stale Marriage Problem
1
Topics
Stable marriage problem
2
Exercises
Problem 1: Determining all stable matchings
Enumerate all the stable matchings for the four men and four women with the following preference lists.
m1 :w3 > w1 > w4 > w2
m2 :w3 > w2 > w4
Stale Marriage Problem
1
Topics
Stable marriage problem
2
Exercises
Problem 1: Determining all stable matchings
Enumerate all the stable matchings for the four men and four women with the following preference lists.
m1 :w3 > w1 > w4 > w2
m2 :w3 > w2 > w4
Sorting and Order Statistics
1
Topics
1. Sorting
2. Order statistics
2
Exercises
Problem 1: Insertion sort
Insertion sort can be expressed as a recursive procedure as follows. In order to sort A[1.n], we
recursively sort A[1.n 1] and then insert A[n] into
Fundamental Tools for Algorithmic Problem Solving
The collection of problems is designed to test the competency of the students in applying
fundamental mathematical tools for algorithmic problem solving. Solving these problems requires a
good understandin
Shortest paths
1
Topics
Minimum spanning trees
Shortest paths (Dijkstras algorithms, shortest-path algorithms in the presence of negative
edge weights)
2
Exercises
Problem 1: Divide-and-conquer spanning tree (CLRS)
Professor Toole proposes a new divide-
Design and Analysis of Algorithms Undergraduate Level
The collection of problems is designed to test the studentscompetency in the design and analysis
of algorithms at the undergraduate level. Solving these problems requires an understanding and
applicati
Shortest paths
1
Topics
Minimum spanning trees
Shortest paths (Dijkstras algorithms, shortest-path algorithms in the presence of negative
edge weights)
2
Exercises
Problem 1: Divide-and-conquer spanning tree (CLRS)
Professor Toole proposes a new divide-
Fundamental Tools for Algorithmic Problem Solving
The collection of problems is designed to test the competency of the students in applying
fundamental mathematical tools for algorithmic problem solving. Solving these problems requires a
good understandin
Greedy Method
1
Topics
Greedy algorithms
Minimum spanning trees
Human codes
2
Exercises
Problem 1: Removing edges (DPV)
Design a linear-time algorithm for the following task.
Input: A connected, undirected graph G.
Output: Is there an edge you can remo
Network Flows
1
Topics
Max-ow
Min-Cut
2
Exercises
3
Problems
Problem 1: Problem 7-8, Page 418, KT
Statistically, the arrival of spring typically results in increased accidents and increased need for
emergency medical treatment, which often requires bloo
Motivation for probabilistic reasoning
Modeling of uncertainty
Inherent randomness (e.g., radioactive decay)
Gross statistical dependencies of complex deterministic world (e.g., coin toss)
Probability as guardian of commonsense reasoning
Many empiric
Finding, Counting and Listing all Triangles in
Large Graphs, An Experimental Study
Thomas Schank and Dorothea Wagner
University of Kalrsruhe, Germany
1
Introduction
In the past, the fundamental graph problem of triangle counting and listing
has been studi
CSE 202 Calibration Homework
Fall, 2012
All parts are worth 20 points. Due October 4, start of class
Recurrence Let T (n) be the function given by the recursion: T (n) = nT ( n )
k
for n > 1 and T (1) = 1. Is T (n) O(n ) for some constant k , i.e. is T
bo
Determinant Sums for Undirected Hamiltonicity
Andreas Bjorklund
arXiv:1008.0541v1 [cs.DS] 3 Aug 2010
Abstract
We present a Monte Carlo algorithm for Hamiltonicity detection in an n-vertex undirected graph running in O (1.657n ) time. To the best of our kn
Experimental
Minimum
Cut
CHANDRA S. CHEKURI*
Study of
Algorithms
ANDREW V. GOLDBERG?
MATTHEW S. LEVINE~
CLIFF
DAVID R. KARGER~
STEINS
Abstract
1
Recently, several new algorithms have been developed for the minimum cut problem.
These algorithms are very di
New Tools for Graph Coloring
Sanjeev Arora and Rong Ge
Department of Computer Science, Princeton University
and Center for Computational Intractability
arora/rongge@cs.princeton.edu
Abstract. How to color 3 colorable graphs with few colors is a problem
of
Network Flows
1
Network flow problems
Problem 1: Blood supply (KT)
Statistically, the arrival of spring typically results in increased accidents and increased need for emergency
medical treatment, which often requires blood transfusions. Consider the prob