From 9b97ff2fa981f22b5be84a398c9bd4f011c9484e Mon Sep 17 00:00:00 2001 From: rjawor Date: Sun, 19 Apr 2015 12:46:34 +0200 Subject: [PATCH] optimal match notes Former-commit-id: de82da8922bae9fe913fd85e80397c95a69198ca --- CONCORDIA_OPTIMAL_MATCH.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 CONCORDIA_OPTIMAL_MATCH.txt diff --git a/CONCORDIA_OPTIMAL_MATCH.txt b/CONCORDIA_OPTIMAL_MATCH.txt new file mode 100644 index 0000000..c534ebd --- /dev/null +++ b/CONCORDIA_OPTIMAL_MATCH.txt @@ -0,0 +1,27 @@ +S = set of concordia results +maxCoverage = empty // max coverage + +/* +getPossibleCoverages + param A - set of concordia results, current coverage + return isTerminal - returns true if nothing from S can be added to A +*/ +boolean getPossibleCoverages(A) { + allTerminal = true + for s in S: // to consider - sort intervals in S and always search from the last interval in A + // however - how to sort the intervals? maybe by their ends? + if not A intersects {s} // given the above, this check would only require to check if s overlaps with the last interval in A + allTerminal = allTerminal and getPossibleCoverages(A+{s}) + + if allTerminal then + score = scoreCoverage(A) + if score > scoreCoverage(maxCoverage) + maxCoverage = A + + return true + else + return false +} + + +