make_partitions(items, test)
The function test
is assumed to be transitive: if test(a, b)
and test(b, c)
return True
, then test(a, c)
must also be True
.
Items to partition
A function that will be called with 2 arguments, taken from items. Should return :None:None:`True`
if those 2 items need to end up in the same partition, and :None:None:`False`
otherwise.
A list of sets, with each set containing part of the items in :None:None:`items`
, such that all(test(*pair) for pair in itertools.combinations(set, 2))
== True
Partitions items into sets based on the outcome of test(item1, item2)
. Pairs of items for which test
returns :None:None:`True`
end up in the same set.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them