From 7626162d6cf3acac386ed8198003d7dbb5ef10b4 Mon Sep 17 00:00:00 2001
From: Marco van Oort <marcovoort@gmail.com>
Date: Thu, 3 Nov 2016 16:47:28 +0100
Subject: [PATCH] Update documentation on mondriaanOpt about the imbalance
 subtlety and the matlab interface

---
 docs/MATLAB.html          | 17 +++++++++++++++--
 docs/USERS_GUIDE_OPT.html | 17 +++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/docs/MATLAB.html b/docs/MATLAB.html
index 2cf1aec..a02a9d6 100644
--- a/docs/MATLAB.html
+++ b/docs/MATLAB.html
@@ -244,6 +244,18 @@ This concludes this small tutorial.
 More information is available through issueing <tt>help mondriaan</tt> from within MATLAB.
 </p>
 
+<h3>MondriaanOpt</h3>
+Apart from Mondriaan itself, also MondriaanOpt is available in MATLAB through the MatlabMondriaanOpt MEX routine.
+Example matlab functions are given in mondriaanOpt.m and mondriaanOptPlot.m.
+The interface of mondriaanOpt is as follows:
+<ul>
+<li><tt>[I, s] = mondriaanOpt(A, Imbalance, Volume)</tt></li>
+</ul>
+Here, <tt>A</tt> is the sparse matrix to be partitioned, <tt>Imbalance</tt> is the maximum allowed load imbalance,
+<tt>Volume</tt> is the initial upper bound on the volume, <tt>I</tt> contains the partitioning information and
+<tt>s</tt> contains statistics about the run.
+For more information, type <tt>help mondriaanOpt</tt> or <tt>help mondriaanOptPlot</tt> in MATLAB.
+
 
 <h3>References</h3>
 <p>
@@ -263,11 +275,12 @@ Vol. 32, Issue 6, pp. 3426-3446 (2010).<br>
 </p>
 <hr>
 <p>
-Last updated: 21st of August, 2013.<br><br>
+Last updated: November 3, 2016.<br><br>
 July 27, 2010 by Bas Fagginger Auer,<br>
 December 10, 2010 by A. N. Yzelman,<br>
 March 27, 2012 by Bas Fagginger Auer,<br>
-August 29, 2013 by Rob Bisseling and Bas Fagginger Auer.<br><br>
+August 29, 2013 by Rob Bisseling and Bas Fagginger Auer.<br>
+November 3, 2016 by Marco van Oort.<br><br>
 To <a href="http://www.staff.science.uu.nl/~bisse101/Mondriaan">
 Home page Mondriaan package</a>.</p>
 
diff --git a/docs/USERS_GUIDE_OPT.html b/docs/USERS_GUIDE_OPT.html
index e6a6705..8db3985 100644
--- a/docs/USERS_GUIDE_OPT.html
+++ b/docs/USERS_GUIDE_OPT.html
@@ -54,6 +54,8 @@ The MondriaanOpt program has the following interface:
 <ul><li><tt>% ./tools/MondriaanOpt matrix [P [eps]] [options]</tt></li></ul>
 One, two or three parameters may be passed, after which further options may be given.
 Either [eps], -e or -k must be passed, and it is advised to pass -v (see <a href="#opts">options</a>).
+Take note that while MondriaanOpt may be called with the same parameters as Mondriaan, the actual problem
+being solved may be <a href="#constraint">slightly different</a>.
 </p>
 
 <p>
@@ -238,6 +240,17 @@ Apart from the matrix, at least one of [eps], -e or -k must be given, defining t
 	</tbody>
 </table>
 
+<h3><a name="constraint">Difference in imbalance constraints</a></h3>
+While the command line interface of MondriaanOpt can be used just as Mondriaan, there is a subtle difference in the problem being solved in these two.
+More precisely, with <tt>N</tt> being the total number of nonzeros, <tt>p</tt> being the total number of processors (which equals 2) and
+<tt>load</tt> the number of nonzeros assigned to a processor, compare:
+<ul>
+	<li>the imbalance constraint <tt>load &lt;= (1+epsilon) (N/p)</tt> which is used in Mondriaan (In the code, this amounts to <tt>floor( ((1+epsilon)*N)/p )</tt>.), and</li>
+	<li>the imbalance constraint <tt>load &lt;= (1+epsilon) ceil(N/p)</tt> which is used in MondriaanOpt.</li>
+</ul>
+As <tt>p=2</tt>, this difference may only be of importance whenever <tt>N</tt> is odd.
+In [<a href="#cite1">1,p.2</a>] it is explained that this different choice was made to ensure feasibility of the problem, even if <tt>epsilon=0</tt>.
+
 
 <h3><a name="matl">Using MondriaanOpt in MATLAB</a></h3>
 
@@ -257,8 +270,8 @@ Daniel M. Pelt and Rob H. Bisseling, <i>Journal of Parallel and Distributed Comp
 
 <hr>
 <p>
-Last updated: October 27, 2016.<br><br>
-October 27, 2016 by Marco van Oort.<br><br>
+Last updated: November 3, 2016.<br><br>
+November 3, 2016 by Marco van Oort.<br><br>
 To <a href="http://www.staff.science.uu.nl/~bisse101/Mondriaan">
 the Mondriaan package home page</a>.</p>
 
-- 
GitLab