Closed clue closed 5 years ago
I still see how this could potentially be useful, but given the discussion in #19 (and others), I don't see me chasing this any time soon. Accordingly, I don't see it's likely this will get traction any time soon, so I will have to close this for now.
A lot of our algorithms would benefit from a dedicated
Result
interface, which saves the intermediary result for further operations. Also, passing its arguments to thecreateResult()
method instead of the constructor allows for a much cleaner design by interchanging the actual algorithm implementation (via dependency injection).For example, calling the following code always calculates the whole algorithm and then only returns a subset of its results:
Instead, I'd like to propose something like this, which makes it clear when the actual algorithm runs:
This applies to at least
MaxFlow
,MaximumMatching
,MinimumCostFlow
,MinimumSpanningTree
,ShortestPath
,TravelingSalesmanProblem
and perhaps a few others.I'm opening this one as a way to discuss this concept and also to link the first batch of PRs against. I'd love to get some feedback!