// Path: src/main/java/de/jfschaefer/layeredgraphlayout/util/Pair.java
// public class Pair<A, B> {
//     public final A first;
//     public final B second;
//     public Pair(A first, B second) {
//         this.first = first;
//         this.second = second;
//     }
// }


import de.jfschaefer.layeredgraphlayout.util.Pair;
import java.util.*;
package de.jfschaefer.layeredgraphlayout.lgraph;



/**
 * Created by jfschaefer on 7/31/15.
 */

public class Layer {
    protected int layer;
    protected ArrayList<LNode> elements;

    protected LGraphConfig config;

    public Layer(int layer, LGraphConfig config) {
        this.layer = layer;
        elements = new ArrayList<LNode>();
        this.config = config;
    }

    public void addNode(LNode node) {
        node.setPos(elements.size());
        elements.add(node);
    }

    ArrayList<LNode> getElements() {
        return elements;
    }
// Path: src/main/java/de/jfschaefer/layeredgraphlayout/util/Pair.java
// public class Pair<A, B> {
//     public final A first;
//     public final B second;
//     public Pair(A first, B second) {
//         this.first = first;
//         this.second = second;
//     }
// }


// Path: src/main/java/de/jfschaefer/layeredgraphlayout/lgraph/Layer.java
import de.jfschaefer.layeredgraphlayout.util.Pair;
import java.util.*;

package de.jfschaefer.layeredgraphlayout.lgraph;



/**
 * Created by jfschaefer on 7/31/15.
 */

public class Layer {
    protected int layer;
    protected ArrayList<LNode> elements;

    protected LGraphConfig config;

    public Layer(int layer, LGraphConfig config) {
        this.layer = layer;
        elements = new ArrayList<LNode>();
        this.config = config;
    }

    public void addNode(LNode node) {
        node.setPos(elements.size());
        elements.add(node);
    }

    ArrayList<LNode> getElements() {
        return elements;
    }
    ArrayList<Pair<LNode, LNode>> getChildConnections() {