GraphDescription operator()(){ std::vector<VertexDescription> vertices; unsigned int vertexId = 0; for(unsigned int stage = 0; stage < verticesCount.size(); stage++) { for(unsigned int i = 0; i < verticesCount[stage]; i++) { vertices.push_back(std::make_pair(vertexId++, VertexProperty(stage))); std::cout << "vertex.push_back" << vertexId -1 << " " << stage << std::endl; } }; std::vector<EdgeDescription> edges; for(const auto& v : vertices) { for(const auto& vNext : vertices) { std::cout << "v.second " << v.second << " vNext.second " << vNext.second << std::endl; if((v.second + 1 == vNext.second)) { std::cout << v.first << "->" << vNext.first << std::endl; edges.push_back( std::make_pair( std::make_pair( v.first, vNext.first ), EdgeProperty() ) ); } } } return std::make_pair(vertices,edges); }
/*! \brief Construct an edge. * * \param startName the name of the node at the start of the edge. * \param endName the name of the node at the end of the edge. */ Edge(std::string startName, std::string endName) : std::tuple<std::string, std::string, EdgeProperty>(std::move(startName), std::move(endName), EdgeProperty()) {}
/*! \brief Construct an edge. * * \param startName the name of the node at the start of the edge. * \param endName the name of the node at the end of the edge. */ constexpr Edge(char const* startName, char const* endName) : std::tuple<std::string, std::string, EdgeProperty>(std::move(startName), std::move(endName), EdgeProperty()) {}