MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / get_edges

Method get_edges

cpp_easygraph/classes/directed_graph.cpp:596–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596py::object DiGraph::get_edges() {
597 py::list edges = py::list();
598 std::set<std::pair<node_t, node_t> > seen;
599 for (const auto& ego_edges : this->adj) {
600 node_t u = ego_edges.first;
601 for (const auto& edge_info : ego_edges.second) {
602 node_t v = edge_info.first;
603 const auto& edge_attr = edge_info.second;
604 if (seen.find(std::make_pair(u, v)) == seen.end()) {
605 seen.insert(std::make_pair(u, v));
606 edges.append(py::make_tuple(this->id_to_node[py::cast(u)], this->id_to_node[py::cast(v)],
607 attr_to_dict(edge_attr)));
608 }
609 }
610 }
611 return edges;
612}
613

Callers

nothing calls this directly

Calls 2

attr_to_dictFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected