concordia-library/CONCORDIA_OPTIMAL_MATCH.txt
rjawor 7549703414 best overlay computation
Former-commit-id: 986f3d6b611fd276a7b26073daa0094caf078d1e
2015-04-21 15:14:48 +02:00

26 lines
801 B
Plaintext

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
*/
void 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
getPossibleCoverages(A+{s})
allTerminal = false
if allTerminal then
score = scoreCoverage(A)
if score > scoreCoverage(maxCoverage)
maxCoverage = A
}