class LinearizedChordDiagramGraphGenerator implements GraphGenerator<V, E, V> {

    @Override
    public void generateGraph(
        Graph<V, E> target, VertexFactory<V> vertexFactory, Map<String, V> resultMap)
    {
        /*
         * Add nodes by maintaining a list with vertex multiplicity equal to its degree for sampling
         * purposes.
         */
        List<V> nodes = new ArrayList<>(2 * n * m);
        for (int t = 0; t < n; t++) {
            // add node
            V vt = vertexFactory.createVertex();
            if (!target.addVertex(vt)) {
                throw new IllegalArgumentException("Invalid vertex factory");
            }

            // add edges
            for (int j = 0; j < m; j++) {
                // add outward half degree before sampling
                nodes.add(vt);

                // sample
                V vs = nodes.get(rng.nextInt(nodes.size()));
                if (target.addEdge(vt, vs) == null) {
                    throw new IllegalArgumentException("Graph does not permit parallel-edges.");
                }

                // add inward half-degree after sampling
                nodes.add(vs);
            }
        }

    }

    public  LinearizedChordDiagramGraphGenerator(int n, int m);
    public  LinearizedChordDiagramGraphGenerator(int n, int m, long seed);
    public  LinearizedChordDiagramGraphGenerator(int n, int m, Random rng);

}