| 12 | namespace core { |
| 13 | GraphBase::GraphBase() {} |
| 14 | int64_t GraphBase::add_node_() { |
| 15 | int64_t id = nodes_.size(); |
| 16 | nodes_.resize(id + 1); |
| 17 | return id; |
| 18 | } |
| 19 | int64_t GraphBase::add_edge_(int64_t inode, int64_t onode) { |
| 20 | if (inode < 0 || inode >= nodes_.size()) { |
| 21 | throw std::runtime_error("Graph: invalid input node"); |