private E loadDoubleEdge ( KeyedGraph < V , E > graph , final int startNode , final int endNode , final int edgeID , final double weight ) throws SQLException { // Note: row is ignored since we only need it for weighted graphs. final E edgeTo = graph . addEdge ( startNode , endNode , edgeID ) ; setEdgeWeight ( edgeTo , weight ) ; final E edgeFrom = graph . addEdge ( endNode , startNode , - edgeID ) ; setEdgeWeight ( edgeFrom , weight ) ; return edgeFrom ; }
In directed graphs undirected edges are represented by directed edges in both directions . The edges are assigned ids with opposite signs .