def _xyinit(self,y=None): if y is None: y = rand_ortho1(self.g.order()) x = rand_ortho1(self.g.order()) # translate and normalize: x = x-x[0] y = y-y[0] sfactor = 1.0/max(y.max(),x.max()) return matrix(zip(x*sfactor,y*sfactor))
def optimal_arrangement(self): b = self.balance() y = rand_ortho1(self.g.order()) return self._conjugate_gradient_L(y,b)