bfutils#
all_undersamples#
bidirected_inc#
- gunfolds.utils.bfutils.bidirected_inc(G, D)[source]#
A helper function for determining bidirected edges in an undersampled graph given a previously undersampled graph
- Parameters:
G (dictionary (
gunfolds
graphs)) –gunfolds
format graph G_1 - without undersamplingD (dictionary (
gunfolds
graphs)) –gunfolds
graph G_u a version of G_1 undersampled by u
- Returns:
- Return type:
call_u_conflicts#
call_u_conflicts2#
call_u_conflicts_d#
call_u_equals#
call_u_equals2#
call_undersamples#
cc_all#
cc_undersamples#
- gunfolds.utils.bfutils.cc_undersamples(G_star, steps=1)[source]#
Returns
G_u
forG_star
with default value ofu=2
. If the input graph converges before the requestedu
- an empty list is returned.- Parameters:
G_star (dictionary (
gunfolds
graphs)) –gunfolds
format graphsteps (integer) – undersampling rate - 1 for G_star
- Returns:
- Return type:
check_conflict#
check_conflict_#
check_equality#
compact_call_undersamples#
- gunfolds.utils.bfutils.compact_call_undersamples(G_star)[source]#
Returns a list of all undersampled graphs (including superclique) in binary encoded format
- Parameters:
G_star (dictionary (
gunfolds
graphs)) –gunfolds
format graph- Returns:
a list of all undersampled graphs (including superclique) in binary encoded format
- Return type:
list of integers
compat#
compatible#
dens2edgenum#
- gunfolds.utils.bfutils.dens2edgenum(d, n=10)[source]#
Convert density into the number of extra edges needed for a ring graph to achieve that density
- Parameters:
d (float) – density
n (integer) – number of nodes in the graph
- Returns:
number of extra edges needed for a ring graph to achieve that density
- Return type:
integer
dincrement_u#
directed_inc#
- gunfolds.utils.bfutils.directed_inc(G, D)[source]#
A helper function for determining directed edges in an undersampled graph given a previously undersampled graph
- Parameters:
G (dictionary (
gunfolds
graphs)) –gunfolds
format graph G_1 - without undersamplingD (dictionary (
gunfolds
graphs)) –gunfolds
graph G_u a version of G_1 undersampled by u
- Returns:
- Return type:
dictionary (
gunfolds
graphs)
edgenum2dens#
forms_loop#
iall#
icompat#
ilength#
increment#
increment_u#
- gunfolds.utils.bfutils.increment_u(G_star, G_u)[source]#
Given graph G_star - without undersampling - and its undersampled version G_u, generate the G_{u+1} graph
- Parameters:
G_star (dictionary (
gunfolds
graphs)) –gunfolds
format graph G_1 - without undersamplingG_u (dictionary (
gunfolds
graphs)) –gunfolds
graph G_u a version of G_1 undersampled by u
- Returns:
- Return type:
is_sclique#
loadgraphs#
make_rect#
overshoot#
- gunfolds.utils.bfutils.overshoot(G_star, H)[source]#
Undersample
G_star
until it turns into aG_u
for whichH
is an edge subset. ReturnTrue
in this case. If this does not happen for either of the undersampling rates until teh convergence - returnFalse
- Parameters:
G_star (dictionary (
gunfolds
graphs)) –gunfolds
format graph atu=1
H (dictionary (
gunfolds
graphs)) –gunfolds
format graph at someu
- Returns:
- Return type:
boolean