<How to Use Program for Approximating Submodular Functions>  


This is a JAVA implementation of the Goemans-Harvey-Iwata-Mirrokni's algorithm for 
approximating submodular functions everywhere. See the following paper for the 
algorithm and its verification. 

M. X. Goemans, N.J. Harvey, S. Iwata, and V. Mirrokni, 
Approximating Submodular Functions Everywhere, 
Proceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA 2009), pp.535-544.
http://www.siam.org/proceedings/soda/2009/soda09.php

Our program requires Jama-1.0.2.jar distributed at http://math.nist.gov/javanumerics/jama/ , which is included in our package.

====================================================================================
1. How to Compile the Program 

In the decompressed directory, execute  

>make

to produce EllipsoidalApprox.jar. Note that if your OS is linux, please edit makefile to replace
 JAVAC = javac -encoding Shift_JIS -source 1.2 -classpath "Jama-1.0.2.jar;."
with
 JAVAC = javac -encoding Shift_JIS -source 1.2 -classpath Jama-1.0.2.jar:. 
before executing it.


====================================================================================
2. How to Run the Program  

In EllipsoidApprox.java, select the following 7 kinds of instance types.

 default: the rank function of graphic matroids, where a graph is generated randomly.
 Case  1: maximum value: $f(X)=\max_{i\in X}c_i$ for randomly generated $c\in\mathbb{R}$
 Case  2: covering function: $f(X)=|\bigcup_{i\in X} Y_i|$ for randomly generated $Y_i$'s.
 Case  3: sqaure root of a modular function:$f(X)=\sqrt{\sum_{i\in X}c_i}$
 Case  4: log of a modular function: $f(X)=\log{\sum_{i\in X}c_i}$
 Case  5: log of the determinant: $\hat{f}(X)= \log (\det A[X])$ for some symmetric matrix $A$.
 Case  6: entropy: $\hat{f}(X)= - (\sum_{i\in X}c_i)\cdot \log (\sum_{i\in X}c_i/\sum_{i\in E}c_i)$. 
  In Cases 5,6, we use $f(X)=\hat{f}(X)+\sum_{i\in X}(\hat{f}(V-i)-\hat{f}(V))$ which monotonizes $\hat{f}$.

 * You can create your own submodular functions by extending the submodular class.

Then execute

>make run

to obtain an output in console. 

====================================================================================
4. How to Read the Output

The output is as follows:

Example:
------------------------------------------
approxrate = 2.69033521842021    
3,63,5
approxrate = 2.23606797749979
0,2,5
approxrate = 2.325496534449477
1,10,5
approxrate = 2.3204774044612857
1,7,5
------------------------------------------

The approxrate ratio means $\alpha (n) = max_{X\subseteq E} f(X)/g(X)$, where $g$ is the obtained function.
The next three kind of numbers represent #iterations, computational time, and dimention, respectively, where "#iterations" means how many times this algorithm expands an ellipsoid to larger one.
Theoreticaly, #iterations is known to be at most O(n^3)[1].


====================================================================================
5. LICENSE

Copyright is reserved by Hiroki Okano.
You may redistribute with or without modification under (modified)
BSD license.  See 'LICENSE' file for more detailed information.

Jama-1.0.2.jar has been released at http://math.nist.gov/javanumerics/jama/ to the public domain.

=======================================================================
The code was written by Hiroki Okano in 2009-2010, when he was 
a graduate course student at University of Tokyo. For the bug 
information and other questions, please take contact to: 

Naonori Kakimura
University of Tokyo
Tel: +81 3 5841 6922 Fax: +81 3 5841 6922
E-mail: kakimura@mist.i.u-tokyo.ac.jp 
=======================================================================












