Programming Problem for the 1999 Comprehensive Exam

Similar documents
6 Randomized rounding of semidefinite programs

Programming Problem for the 2002 Comprehensive Exam

An Introduction to Graph Theory

Algorithms for Euclidean TSP

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Exam problems for the course Combinatorial Optimization I (DM208)

CS 441 Discrete Mathematics for CS Lecture 26. Graphs. CS 441 Discrete mathematics for CS. Final exam

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays


Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

CIS 121 Data Structures and Algorithms with Java Spring 2018

8 Matroid Intersection

arxiv: v1 [math.co] 25 Sep 2015

Solving problems on graph algorithms

Core Membership Computation for Succinct Representations of Coalitional Games

Programming Project #2: Solving Quadratic Equations Date Due: Monday 25 September 2017

AMS /672: Graph Theory Homework Problems - Week V. Problems to be handed in on Wednesday, March 2: 6, 8, 9, 11, 12.

E-Companion: On Styles in Product Design: An Analysis of US. Design Patents

D-BAUG Informatik I. Exercise session: week 5 HS 2018

Wireless Sensor Networks Localization Methods: Multidimensional Scaling vs. Semidefinite Programming Approach

Chapter 9 Graph Algorithms

Introduction to Machine Learning

Combinatorics Summary Sheet for Exam 1 Material 2019

1 Linear programming relaxation

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

CSC 373: Algorithm Design and Analysis Lecture 8

Graphs. Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1

CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh HW#3 Due at the beginning of class Thursday 02/26/15

Give a short answer (i.e. 1 to 3 sentences) for the following questions:

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type.

MPI Casestudy: Parallel Image Processing

Problem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.

Chapter 9 Graph Algorithms

Figure 2.1: A bipartite graph.

Figure 6.1: Truss topology optimization diagram.

The Matrix Market Exchange Formats:

Programming Assignment 2004 Comprehensive Exam

Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur

COMP260 Spring 2014 Notes: February 4th

Graph Theory: Starting Out

Lecture 9 - Matrix Multiplication Equivalences and Spectral Graph Theory 1

Lec13p1, ORF363/COS323

CSC Linear Programming and Combinatorial Optimization Lecture 12: Semidefinite Programming(SDP) Relaxation

Lecture 9. Semidefinite programming is linear programming where variables are entries in a positive semidefinite matrix.

Module 10A Lecture - 20 What is a function? Why use functions Example: power (base, n)

Mathematics and Computer Science

K-Means and Gaussian Mixture Models

Introduction to Mathematical Programming IE406. Lecture 16. Dr. Ted Ralphs

arxiv: v1 [cs.dm] 21 Dec 2015

Graphs. The ultimate data structure. graphs 1

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

Mining Social Network Graphs

2. CONNECTIVITY Connectivity

This assignment requires that you complete the following tasks (in no particular order).

Introduction to Graph Theory

Algorithm Computation of a Single Source Shortest Path in a Directed Graph. (SSSP algorithm)

arxiv: v1 [math.co] 27 Feb 2015

Bulldozers/Sites A B C D

SHORTEST PATHS ON SURFACES GEODESICS IN HEAT

UNIT 5 GRAPH. Application of Graph Structure in real world:- Graph Terminologies:

15-451/651: Design & Analysis of Algorithms January 26, 2015 Dynamic Programming I last changed: January 28, 2015

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

CMPSCI611: The SUBSET-SUM Problem Lecture 18

Notes for Lecture 24

An exact algorithm for max-cut in sparse graphs

Project Report. 1 Abstract. 2 Algorithms. 2.1 Gaussian elimination without partial pivoting. 2.2 Gaussian elimination with partial pivoting

In this lecture, we ll look at applications of duality to three problems:

Remaining Enhanced Labs

Chapter 3A Rectangular Coordinate System

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions

Bindel, Fall 2011 Applications of Parallel Computers (CS 5220) Tuning on a single core

MathZoom, Summer, 2014

Ensemble methods in machine learning. Example. Neural networks. Neural networks

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

Zhibin Huang 07. Juni Zufällige Graphen

Graphs. The ultimate data structure. graphs 1

Solutions to Problem 1 of Homework 3 (10 (+6) Points)

The Citizen s Guide to Dynamic Programming

Dynamic Programming. Lecture Overview Introduction

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

1 Definition of Reduction

Framework for Design of Dynamic Programming Algorithms

Graphs. Pseudograph: multiple edges and loops allowed

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

Graph Theory: Introduction

Exam 3 Practice Problems

Matrices. A Matrix (This one has 2 Rows and 3 Columns) To add two matrices: add the numbers in the matching positions:

Introduction to Graphs

To add or subtract, just add or subtract the numbers in the same column and row and place answer accordingly.

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

Introduction to MATLAB Programming

SPERNER S LEMMA MOOR XU

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

Graph Coloring. Margaret M. Fleck. 3 May This lecture discusses the graph coloring problem (section 9.8 of Rosen).

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

Varying Applications (examples)

Dynamic Programming Homework Problems

Transcription:

Programming Problem for the 1999 Comprehensive Exam Out: Monday 1/25/99 at 9:00 am Due: Friday 1/29/99 at 5:00 pm Department of Computer Science Brown University Providence, RI 02912 1.0 The Task This year you are going to study the effectiveness of approximation algorithms to NP-complete problems. In particular you are going to look at the MAX CUT problem and empirically investigate several different approximation algorithms acting on several different types of graphs. 2.0 The MAX CUT Problem MAX CUT is one of the large class of NP-complete graph problems. Here one is given an undirected graph with weighted edges. The task is to divide the nodes of the graph into two distinct sets such that the sum of the weights of the edges that go from a node in one set to one in the other set is maximized. Formally, given an undirected graph G = ( V, E) and weights w i, on the edges ( i, ) E, the maximum cut problem (MAX CUT) is that of finding the set of vertices S that maximizes the weight of the edges in the cut ( S, S) ; that is the weight of the edges with one endpoint in S and the other in S. For simplicity, one usually sets = for ( i, ) E and denote the weight of a cut ( S, S) by w i, 0 wss (, ) = w i, i S, S Thus, one wants to find S such that wss (, ) is maximized. This problem has been known to be NP-complete for a long time, even in the unweighted case. However, it is an important problem with applications in circuit layout design and statistical physics and hence often needs to be approximated. 1999 Comprehensive Exam 1 Programming Problem

Most of the approximation algorithms that have been proposed only guaranteed to get within 1/2 of the optimal solution. In 1994 a new algorithm was proposed based on semidefinite programming (article attached) that offered a 0.87856 guarantee. It is this algorithm that you are going to compare to three much simpler ones on a bunch of graphs you will generate yourself to see if the additional complexity is actually worth it. 3.0 Task Specifics You are to code up four approximation algorithms to the MAX CUT problem. These are described in the next section. Then you are to generate a series of graphs using the criteria in the following section. You are to run each of your algorithms on each of the graphs (it would probably be easiest if this was all one within one program) and compare the results. At the end you should produce a summary showing how well each of the algorithms did. 4.0 Approximation Algorithm In this section we detail the four approximation algorithms you are to use. 4.1 Random Cut The simplest algorithm is ust to randomly select the set of nodes S. A random selection of S actually is not a bad approximation: it has an average case value of 1/2 of the optimal solution. Note that the easiest way of randomly choosing S is to take each node and randomly decide if it is in S or not in S. 4.2 Greedy Here one looks at each node in turn and then assigns it to either S or S based on whichever increases the size of the cut the most. One can either look at the nodes in a random order or in the order they are given. 4.3 Your Algorithm The third algorithm is one of your own devising. It need not be all that complex it can simply be a modification of one of the above but you should try to have it get good results (i.e. it should be able to do better than either of the above two naive algorithms). 4.4 Semidefinite Programming This algorithm gets somewhat complex if you try to understand how and why it works, but you really only need to understand how to code it to successfully 1999 Comprehensive Exam 2 Programming Problem

complete this problem. Moreover, we are not expecting you to write a semidefinite programming solver; that is being provided to you. The algorithm is as follows: 1. Set up the semidefinite programming problem to obtain the matrix Y: max 1 2 -- subect to: w i i< Y, ( 1 y i, ) y ii, = 1 = y i, symmetric and positive semidefinite To make this tractable, we have provided you with a subroutine for semidefinite programming. The library libsemidef.so contains the routine: extern int solvesemidef(int n, // dim of W, D, Y double * w, // N x N Matrix W (see below) double * d, // N Vector D double * y) // N x N Matrix Y (see below) which solves the semidefinite programming problem of maximizing i< ( ) W i, Y i, where W i, is a symmetric NxN matrix of constants and Y i, is an NxN matrix of terms to be found subect to the constraints that Y is symmetric positive semidefinite Y ii, = D i for the given set of constants D i 0 The matrices Y and W are stored in row-maor, upper triangular form, i.e. w[0] = W[1,2] w[1] = W[1,3]... w[n-2] = W[1,n] w[n-1] = W[2,3]... to save space. (Note that the diagonal elements are not needed: the W elements are never used while the Y diagonal is assumed equal to D.) 1999 Comprehensive Exam 3 Programming Problem

2. Use a Cholesky decomposition to find the lower triangular matrix B such that Y = B T B : 1 k 1 -- 2 2 B k, k = Y k, k B k, p p = 1 B ik, = k 1 Y ik, B i, p B k, p p = 1 B k, k -----------------------------------------------, i = k+1,...,n 3. Let v i be the i th column of B. 4. Choose a random vector r uniformly distributed on the unit sphere S n. This can be done by selecting n values x 1, x 2,, x n randomly from a normal (not uniform) distribution and then normalizing the vector so obtained. 5. Set S = { i v i r 0} where dot indicates the dot product of the two vectors. 5.0 Testing Graphs You should compare these algorithms on a variety of graphs. The graphs should be of moderate size, but not overly large. (The code for semidefinite programming is polynomial, but not necessarily small polynomial.) More importantly, you want to try a variety of graphs (and several instances of each variety enough to get a good basis for comparison). The different types of graphs to try include: Random graphs. You should generate random graphs of various sizes with different densities of edges. You can try various different ways of generating random graphs if you are so inclined. Bipartite graphs. Just for fun and to test your algorithms you should try some bipartite graphs (here the MAX CUT solution is obvious). Grid graphs. Divide the unit square into four quadrants. Now generate random points in the square. Each point represents a node of the graph. Two points have an edge between them if the distance between them is less than δ for some δ. The weight of the edge is w i if both points are in quadrant i, and w i w if one point is in quadrant i and the other in a different quadrant. You can choose different values for δ and the. w i 1999 Comprehensive Exam 4 Programming Problem

Choice graphs. Choose m. Let t m 2. Then the nodes of the graph are the m t-element subsets of (1...m). Two nodes have an edge between them t (with weight 1) if the size of their intersection is exactly b for some small b. Note that you probably cannot let m get too big and that b will have to be small in order for this to be practical. 6.0 Mechanics You can write your program in any language you want. We are providing the code for semidefinite programming as a shared library callable from C or C++ and as a Java class. If you want to use some other language you will have to interface to this code yourself. (I would not suggest that you try to write your own semidefinite programming solver it would be hard to get done in a month, much less a week.) We are providing the libraries on the departmental suns. If you must use another machine for this proect, we will provide the source for our library and the other libraries that it uses. Note here that some of these libraries require a Fortran compiler and that we will make no guarantees that things will work. The header file semidef.h and the library libsemidef.so are both located in /map/aux1fred/comps/semidef in the include and lib directories respectively. The source as we have it is in the src directory. For Java, the directory /map/aux1fred/comps/ava should be added to the CLASSPATH and the class is accessed as brown.comps.semidef (it should be a self-loading native method). You should hand in your program, sample runs, and whatever output you have to demonstrate your conclusions about the different algorithms on the different classes of graphs. You should also include a brief write-up that describes your own algorithm. Handins should be done electronically if at all possible into the directory /map/aux1fred/comps/handins/### where ### is the random number you assign yourself. You should have permissions to create this directory and should protect it accordingly. All work that you hand in is expected to be your own. You should not discuss your work or ideas with anyone else. You should not share code or ask others for advice on your code. You should not read others code (whether those here or code obtained elsewhere) that duplicates in any way what you are to write. You may look at the source of the semidefinite solver that is provided if you think that would be helpful. You may ask Dr. Reiss questions either in person or via email. Any answers or information that should be known to all will be posted in the comps news group which is your responsibility to read. 1999 Comprehensive Exam 5 Programming Problem

7.0 Caveats This problem involves a bit of mathematics (not all that much) and a bit of numerical analysis. You should be careful when dealing with floating point numbers. The values you get back from the semidefinite programming solver, for example, will not be exact (we are only giving you three or four digits accuracy). It is possible then for the Cholesky decomposition to then get negative numbers where the numbers should be zero or close there to, and the system does not like taking square roots of negative numbers. 1999 Comprehensive Exam 6 Programming Problem