Remove special_targets and other improvements #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request bundles the following improvements:
Initial nodes begin fully connected
By fully connecting the first
k
nodes, they will start with a degree ofk-1
. The update rule starts with nodek+1
which will connect to all existingk
nodes as there are no duplicates allowed. Afterk+1
joined, all nodes will thus have degreek
. This sets the minimum degree tok
and avoids isolated nodes.Improved tests
Test cases are improved to test for minimum degree
k
, exact number of links and increasing graph clustering when triadic closure is used.Code simplification
Improved type hints, documentation and removed redundant code.
More importantly, models with triadic closure are simplified. The class
netin.TriadicClosure
is now responsible for keeping track of triadic closure candidates (898528c) and for performing the actual tc-based target selection. As only triadic closure model variants need to keep track of respective tc candidates, this functionality is now bundled innetin.TriadicClosure
and removed from all super classes. Moreover,netin.TriadicClosure
makes use of the existingon_edge_added
-method to update the candidates.Whether tc (or another mechanism) is chosen, should be implemented in the actual model implementations. For this purpose, a single base class
netin.GraphTC
is introduced in b7b8cc3.This class performs the decision whether tc is executed or whether an alternative mechanism is chosen.
Concrete model variants (e.g.,
netin.PATCH
ornetin.TCH
) then inherit fromnetin.GraphTC
and only reimplementGraphTC.get_probabilities_regular
to specify which exact alternative to triadic closure is performed.