higra / Higra

Hierarchical Graph Analysis
Other
97 stars 20 forks source link

Tree children #228

Closed PerretB closed 3 years ago

PerretB commented 3 years ago

solves #225 : children are not computed in the tree constructor anymore to save space.

In C++ the children relation is only available on request: one must call the function compute_children prior to calling any of the functions related to children access (otherwise the behavior is undefined). Computing the children relation is a linear time operation that will require in the order of n + 3m words of memory where n is the number of nodes in the tree and m is the number of non-leaf nodes (1 word is equal to 64bits on a x64 platform).

The children relation can be cleared to save space with the function clear_children and the status of the relation can be checked with the function children_computed.

In Python the relation is automatically computed when needed, the relation can be cleared with the function clear_children.

codecov[bot] commented 3 years ago

Codecov Report

Merging #228 (5406fbd) into master (c6e016e) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #228      +/-   ##
==========================================
+ Coverage   98.79%   98.82%   +0.02%     
==========================================
  Files          44       44              
  Lines        4471     4577     +106     
==========================================
+ Hits         4417     4523     +106     
  Misses         54       54