class ExplicitToImplicit extends AbstractFunction<Graph, Graph> {

    public Graph apply(final Graph g) {

        Graph h = new Graph(g.order());

        // atom/topology information doesn't change
        for (int u = 0; u < g.order(); u++) {
            h.addAtom(g.atom(u));
            h.addTopology(g.topologyOf(u));
        }

        // transform edges
        for (int u = 0; u < g.order(); u++) {
            for (final Edge e : g.edges(u)) {
                if (e.other(u) > u)
                    h.addEdge(toImplicitEdge(g, e));
            }
        }

        return h;
    }

}