@Override
    public void arrange(List<VisualNode> nodes, double MAXR, double MINR, double width, double height) {
        int DEFAULTX = (int)MAXR * 2, DEFAULTY = (int)MAXR * 2;
        
        int x = DEFAULTX, y = DEFAULTY;
        int n = nodes.size();
        int maxcol = (int)(width / (MAXR * 3));
        int nodeEachRow = (int)Math.sqrt(n);       
        if(nodeEachRow < 6){
            nodeEachRow = 6;
        }else if(nodeEachRow > maxcol){
            nodeEachRow = maxcol;
        }
        int col = 0;
        for(VisualNode node:nodes){
            if(animationOn){
                node.changePosition(x, y);
            }else{
                node.setX(x);
                node.setY(y);
            }
            x += MAXR * 3;
            col++;
            if(col >= nodeEachRow){
                x = DEFAULTX;
                y += MAXR * 3;
                col = 0;
            }
        }
    }