You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the createResult() 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:
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: