Commit 4323e370 authored by Tiago Peixoto's avatar Tiago Peixoto

Small optimization in sfdp_layout() and change of default cooling_step parameter.

parent 448a914b
......@@ -144,7 +144,10 @@ inline double f_r(double C, double K, double p, const Pos& p1, const Pos& p2)
double d = dist(p1, p2);
if (d == 0)
return 0;
return -C * pow(K, 1 + p) / pow(d, p);
if (round(p) == p)
return -C * power(K, int(1 + p)) / power(d, int(p));
else
return -C * pow(K, 1 + p) / pow(d, p);
}
template <class Pos>
......
......@@ -507,7 +507,7 @@ def coarse_graph_stack(g, c, coarse_stack, eweight=None, vweight=None,
def sfdp_layout(g, vweight=None, eweight=None, pin=None, groups=None, C=0.2,
K=None, p=2., theta=0.6, max_level=11, gamma=1., mu=0., mu_p=1.,
init_step=None, cooling_step=0.9, adaptive_cooling=True,
init_step=None, cooling_step=0.99, adaptive_cooling=True,
epsilon=1e-1, max_iter=0, pos=None, multilevel=None,
coarse_method="hybrid", mivs_thres=0.9, ec_thres=0.75,
coarse_stack=None, weighted_coarse=False, verbose=False):
......@@ -549,7 +549,7 @@ def sfdp_layout(g, vweight=None, eweight=None, pin=None, groups=None, C=0.2,
connected component, or group assignment.
init_step : float (optional, default: ``None``)
Initial update step. If not provided, it will be chosen automatically.
cooling_step : float (optional, default: ``0.9``)
cooling_step : float (optional, default: ``0.99``)
Cooling update step.
adaptive_cooling : bool (optional, default: ``True``)
Use an adaptive cooling scheme.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment