<div id="api_guide">
  <h2>Optimality Criteria</h2>

  <div id="input_format_contents">
    <h3>Table of Contents</h3>
    <ul>
      <li><a href="#intro">Introduction</a></li>
      <li><a href="#optimal">Optimal</a></li>
      <li><a href="#maxcard">Maxcard</a></li>
    </ul>
  </div>

  <div id="intro" class="formats">
    <h3>Introduction</h3>

    <p>In this section we describe exactly what it means when we say that the output from the algorithm is optimal. This
      definition of optimal dictates exactly what is output when the <code>operation</code> parameter in the various API
      calls is set to <code>optimal</code>.  We also describe the constraints on the set of exchanges when the parameters
      <code>maxcard</code> and <code>pairs</code> are used.
    </p>

  </div>

  <div id="optimal" class="formats">
    <h3>Optimal</h3>

    <p>When the operation parameter to the various API calls is set to optimal we return a set of exchanges that
      are derived from a set of constraints as defined below:</p>

    <ol id="optimality_list"  class="criteria_list">
      <li>the number of effective pairwise exchanges is maximised; <sup>[<a name="effective" href="#fn1">*</a>]</sup>
      </li>
      <li>subject to (1), the total number of transplants is maximised;<sup>[<a name="size" href="#fn2">&dagger;</a>]</sup></li>
      <li>subject to (1)-(3), the number of 3-way exchanges is minimised;</li>
      <li>subject to (1)-(4), the number of back-arcs in the 3-way exchanges is maximised;</li>
      <li>subject to (1)-(5), the overall weight is maximised.</li>
    </ol>

    <div class="footnotes">
      <div class="footnote">
        <p><sup>[<a name="fn1" href="#effective">*</a>]</sup>
        And thus equal to the number of pairwise exchanges in a maximum cardinality solution consisting of only pairwise
        exchanges.</p>
        <p><sup>[<a name="fn2" href="#size">&dagger;</a>]</sup>
        The total number of transplants is defined to be the number of unmatched altruistic donors plus twice the
        number of pairwise exchanges plus three times the number of 3-way exchanges.</p>
      </div>
    </div>

  </div>


  <div id="maxcard" class="formats">
    <h3>Maxcard</h3>

    <p>When the operation parameter is set to <code>maxcard</code> we relax somewhat the set of constraints that are
    applied. Running the algorithms with this setting returns us the largest possible matching in terms of size, i.e. it is not
    constrainted by maximising the overall number of effective pairwise exchanges, or by altruistic donors.
    The exact set of criteria are shown below:</p>

    <ol id="maxcard_list" class="criteria_list">
      <li>the total number of transplants is maximised;<sup>[<a name="maxcard-size" href="#fn3">&dagger;</a>]</sup></li>
      <li>subject to (1), the overall weight is maximised.</li>
    </ol>

    <div class="footnotes">
      <div class="footnote">
        <p><sup>[<a name="fn3" href="#maxcard-size">&dagger;</a>]</sup>
        The total number of transplants is defined to be the number of unmatched altruistic donors plus twice the
        number of pairwise exchanges plus three times the number of 3-way exchanges.</p>
      </div>
    </div>

  </div>

  <div id="pairs" class="formats">
    <h3>Pairs</h3>

    <p>The <code>pairs</code> operation returns the  set of pairwise exchanges such that:</p>

    <ol id="pairwise_list" class="criteria_list">
      <li>the total number of transplants is maximised;</li>
      <li>subject to (1), the overall weight is maximised.</li>
    </ol>

  </div>

</div>