This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
Searches a graph and yields all the minimum spanning trees in order of increasing cost. | |
This could be used to solve minimum spanning trees with constraints by yielding trees until | |
we reach the first one which satisfies a constraint. | |
For example it could solve the degree constrained minimum spanning tree DCMST | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// @author Nicolas Roy @niroyb | |
// @date 2013-04-22 | |
// Disjoint set data structure aka unionfind | |
// Time complexity of log(n) for all operations because of map.find() | |
#include <map> | |
template<class verticeType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Groupe les notes et permet de trouver les seuils''' | |
import re | |
from collections import defaultdict | |
with open('Resultat.txt') as f: | |
text = f.read() | |
matches = re.findall('((?:[A-F])(?:\*|\+|\s))\s*\|\s*([0-9.]+)', text) | |
print len(matches), 'notes :' |