comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -2,9 +2,11 @@ using System;
// ReSharper disable ReturnTypeCanBeEnumerable.Global
// ReSharper disable ParameterTypeCanBeEnumerable.Local
namespace EscapeRoomEngine.Engine.Runtime.Utilities
{
/// <summary>
/// The backtrack algorithm can calculate the subset of a set of samples with the sum closest to a target value.
/// </summary>
public struct Backtrack
{
private int[] indices;
@@ -95,6 +97,9 @@ namespace EscapeRoomEngine.Engine.Runtime.Utilities
return Sum(leave) < Sum(pick) ? leave : pick;
}
/// <summary>
/// Combine the two brute force algorithms to calculate the optimal subset.
/// </summary>
public int[] BruteForce()
{
var lower = BruteForceLower();