optimal match notes
Former-commit-id: de82da8922bae9fe913fd85e80397c95a69198ca
This commit is contained in:
parent
e3d477dc3a
commit
9b97ff2fa9
27
CONCORDIA_OPTIMAL_MATCH.txt
Normal file
27
CONCORDIA_OPTIMAL_MATCH.txt
Normal file
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user