The time complexity of Alg.~\ref{alg:building} is $O(|T||K| \log(|K|) + |LB||K|^2)$, where $LB$ is the set of label bags ($|LB|\leq |T|$). Indeed the labels of every topology need to be ordered (for comparison with other label bags) and it can be done with time complexity $O(|K| \log(|K|))$. Grouping label bags can be done in time $O(|T||K|)$ on the average by using a hash table. Inserting a label bag in the TopoIndex can be done in time $O(|LB||K|^2)$ since for every unlabeled topologies at most $|K|$ nodes need to be looked up by the recursive call $create\_dag()$ and looking up a node can be done in time $O(|K|)$. Since $|K|$ is usually very small, the building time can be assumed to be linear over $|T|$.  
