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

Method get_edges

cpp_easygraph/classes/graph.cpp:686–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684}
685
686py::object Graph::get_edges() {
687 py::list edges = py::list();
688 std::set<std::pair<node_t, node_t> > seen;
689 for (const auto& ego_edges : this->adj) {
690 node_t u = ego_edges.first;
691 for (const auto& edge_info : ego_edges.second) {
692 node_t v = edge_info.first;
693 const auto& edge_attr = edge_info.second;
694 if (seen.find(std::make_pair(u, v)) == seen.end()) {
695 seen.insert(std::make_pair(u, v));
696 seen.insert(std::make_pair(v, u));
697 edges.append(py::make_tuple(this->id_to_node[py::cast(u)], this->id_to_node[py::cast(v)], attr_to_dict(edge_attr)));
698 }
699 }
700 }
701 return edges;
702}
703
704
705Graph_L Graph::_get_linkgraph_structure() {

Callers

nothing calls this directly

Calls 2

attr_to_dictFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected