Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
ae5b52ae
Commit
ae5b52ae
authored
May 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fcd7d1b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+4
-13
No files found.
wcfs/internal/xbtree.py
View file @
ae5b52ae
...
...
@@ -240,20 +240,11 @@ def Restructure(ztree, newStructure):
# The process of insert/forget is organized as follows:
# 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 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)
# and note Ai with max(δB(Ai)) to be forgotten.
# - after As are forgotten or some Bs are associated with new, we associate
# 1-1 the rest of A with the rest of B since all those nodes come in key↑ order.
# - compute D(Ai,Bj) where D is distance in between ranges
# - find solution to linear assignment problem A <- B with the cost given by D
# https://en.wikipedia.org/wiki/Assignment_problem
#
# sum min d(a,b) sum min d(a,b)
# a∈A b∈B b∈B a∈A
# D(A,B) = ────────────── + ────────────── XXX -> D(A,B) = |A.lo, B.lo| + |A.hi - B.hi|
# N(A) N(B)
#
# XXX ^^^ -> assignment problem
# D(A,B) = |A.lo, B.lo| + |A.hi - B.hi|
# we will modify nodes from new set:
# - node.Z will point to associated znode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment