public static EdgeDoubleDictionary UnaryWeightsFromEdgeList(IEdgeListGraph graph) { if (graph == null) { throw new ArgumentNullException("graph"); } EdgeDoubleDictionary dictionary = new EdgeDoubleDictionary(); IEdgeEnumerator enumerator = graph.get_Edges().GetEnumerator(); while (enumerator.MoveNext()) { IEdge edge = enumerator.get_Current(); dictionary.set_Item(edge, 1.0); } return dictionary; }