Re: Slides about "ideal" algorithm for call next Tuesday

On 2 August 2014 09:24, Peter Thatcher <pthatcher@google.com> wrote:
> I have prepared and attached slides for the call next Tuesday.  It
> presents two possible algorithms for "ideal", and recommends the
> first, called "min distance".  It is the combination of input from
> many people in the WG, and I hope we have finally found a solution
> that everyone can agree to.

I'm still in the non-deterministic camp here, but can live with the
first part of this.

However, why is the advanced algorithm so different and
computationally intense?  The step isn't defined, so it's not going to
be deterministic.

Why not include a simpler algorithm that simply applies advanced
constraints as though they were mandatory, then sorts the resulting
set of sources by the values in ideal:

// inputs...
[mandatory, ideal, advanced] = splitConstraints(constraints);
sources = getAllSources();

sources = applyMandatoryConstraints(sources, mandatory);
if (sources.length === 0) {
  throw new Error('whatever man');
} else if (sources.length === 1) {
  return sources[0];
}

for (adv in advanced) {
  reduced = applyMandatoryConstraints(sources, adv);
  if (reduced.length > 0) {
    return sortByIdeal(reduced, ideal);
  }
}

return sortByIdeal(sources, ideal)[0];

Received on Monday, 4 August 2014 17:21:23 UTC