Skip to content

Commit 2199921

Browse files
danieledlerAnton Eriksson
authored andcommitted
fix: Continue searching from input tree
1 parent 359a166 commit 2199921

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/core/InfomapBase.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,6 @@ InfomapBase& InfomapBase::initPartition(std::string clusterDataFile, bool hard)
489489

490490
if (ext == "tree" || ext == "ftree") {
491491
initTree(clusterMap.nodePaths());
492-
if (!noInfomap) {
493-
noInfomap = true;
494-
//TODO: implement continuing from tree
495-
Log() << "\nNotice: Continuing clustering algorithm after reading input tree currently not supported, assuming --no-infomap for now.\n";
496-
}
497492
} else if (ext == "clu") {
498493
initPartition(clusterMap.clusterIds(), hard);
499494
}
@@ -977,6 +972,19 @@ void InfomapBase::hierarchicalPartition()
977972
{
978973
Log(1) << "Hierarchical partition..." << std::endl;
979974

975+
if (numLevels() > 2) {
976+
Log(1) << "Continuing from a tree with " << numLevels() << " levels..." << std::endl;
977+
978+
if (fastHierarchicalSolution == 0) {
979+
Log(1) << "Removing sub modules...\n";
980+
removeSubModules(true);
981+
m_hierarchicalCodelength = calcCodelengthOnTree(true);
982+
}
983+
984+
recursivePartition();
985+
return;
986+
}
987+
980988
partition();
981989

982990
if (numTopModules() == 1 || numTopModules() == numLeafNodes()) {

0 commit comments

Comments
 (0)