Exemplo n.º 1
0
 public static Decomposition FromLinearDecomposition(LinearDecomposition ld)
 {
     Tree tree = new Tree();
     tree.Insert(ld.Graph.Vertices);
     BitSet parent = ld.Graph.Vertices;
     foreach (int item in ld.Sequence.Take(ld.Sequence.Count - 1))
     {
         tree.InsertWithParent(parent * item, parent);
         tree.InsertWithParent(parent - item, parent);
         parent = parent - item;
     }
     return new Decomposition(ld.Graph, tree)
     {
         // TODO: speed up using this
         //maxNeighborhoodSize = ld.MaxNeighborhoodSize
     };
 }