Commit c1dfed28 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent dfb861a8
......@@ -204,16 +204,16 @@ def Restructure(ztree, newStructure):
# dict with all k->v from ztree
kv = dict(ztree)
# walk original and new strucutres level by level.
# walk original and new structures level by level.
# XXX push buckets till the end
# for each level we have A1...An "old" nodes, and B1...Bm "new" nodes.
# XXX buckets - push till end
# if n == m - map A-B 1-to-1
# if n < m - we have to "insert" (m-n) new nodes
# if n > m - we have to "forget" (n-m) old nodes.
# The process of insert/forget is organized as follows:
# every node from B set will in the end be to a node from A set.
# every node from B set will in the end be associated to a node from A set.
# to make this association we:
# - compute D(Ai,Bj) where D is wighted distance
# - compute D(Ai,Bj) where D is weighted distance
# - if we need to insert, we order Bj by δA(Bj) = min_i D(Ai,Bj)
# and note Bj with max(δA(Bj)) to be associated with newly created nodes.
# - if we need to forget, we order Ai by δB(Ai) = min_j D(Ai,Bj)
......@@ -235,7 +235,7 @@ def Restructure(ztree, newStructure):
zrlevelv = list(__zwalkBFS(ztree)) # [] of _NodeInRange
rlevelv = list( __walkBFS(tnew)) # [] of _NodeInRange
# assotiate every non-bucket node in tnew to a znode
# associate every non-bucket node in tnew to a znode
# extract bucket nodes.
zrbucketv = [] # of _NodeInRange
rbucketv = [] # of _NodeInRange
......@@ -713,7 +713,7 @@ def graphviz(t, clustername=''):
for (i, node) in enumerate(nodev):
assert isinstance(node, (Tree,Bucket))
# register node insymtab
# register node in symtab
assert id(node) not in symtab
kind = ('T' if isinstance(node, Tree) else 'B')
symtab[id(node)] = '%s%s%d:%d' % (clustername+'_', kind, level, i)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment