25template<
typename TNode,
typename TEdge>
69 template<
typename ... Params>
76 template<
typename ... Params>
102 std::string
name()
const override;
110template<
typename TNode,
typename TEdge>
112 TEdge>::getAdjacencyList() const &{
113 return m_adjacency_list;
116template<
typename TNode,
typename TEdge>
118 return std::move(m_adjacency_list);
124template<
typename TNode,
typename TEdge>
129template<
typename TNode,
typename TEdge>
131 m_adjacency_list[std::forward<TNode>(n)];
134template<
typename TNode,
typename TEdge>
135template<
typename... Params>
137 addNode(TNode(std::forward<Params>(params) ...));
142template<
typename TNode,
typename TEdge>
144 if (e.first == e.second) {
148 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
149 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
159template<
typename TNode,
typename TEdge>
161 if (e.first == e.second) {
165 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
166 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
171 m_adjacency_list[e.second].insert(
ext::make_pair(e.first, std::forward<TEdge>(e)));
176template<
typename TNode,
typename TEdge>
177template<
typename... Params>
179 return addEdge(TEdge(std::forward<Params>(params) ...));
184template<
typename TNode,
typename TEdge>
186 return m_adjacency_list.size();
189template<
typename TNode,
typename TEdge>
193 for (
const auto &
i: m_adjacency_list) {
194 cnt +=
i.second.size();
202template<
typename TNode,
typename TEdge>
206 for (
const auto &
i: m_adjacency_list) {
213template<
typename TNode,
typename TEdge>
217 for (
const auto &
i:m_adjacency_list) {
218 for (
const auto &j :
i.second) {
219 vec.push_back(j.second);
228template<
typename TNode,
typename TEdge>
232 if (m_adjacency_list.count(n) == 0) {
236 for (
const auto &
i: m_adjacency_list.at(n)) {
243template<
typename TNode,
typename TEdge>
247 if (m_adjacency_list.count(n) == 0) {
251 for (
const auto &
i: m_adjacency_list.at(n)) {
252 vec.push_back(
i.second);
258template<
typename TNode,
typename TEdge>
260 return successors(n);
263template<
typename TNode,
typename TEdge>
265 return successorEdges(n);
270template<
typename TNode,
typename TEdge>
272 return "UndirectedGraph";
277template<
typename TNode,
typename TEdge>
279 ostream <<
"(" << name() <<
" ";
280 for (
const auto &
i : m_adjacency_list) {
281 ostream <<
i.first <<
" <-->" << std::endl;
283 for (
const auto &j :
i.second) {
284 ostream <<
"\t\t" << j.first <<
" " << j.second << std::endl;
304template<
typename TNode,
typename TEdge>
311 for (
auto &&j:
i.second) {
315 graph.addNode(first);
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: GraphInterface.hpp:19
TEdge edge_type
Definition: GraphInterface.hpp:23
TNode node_type
Definition: GraphInterface.hpp:22
static DefaultNodeType normalizeNode(TNode &&node)
Definition: Normalize.hpp:47
static DefaultEdgeType normalizeEdge(TEdge &&edge)
Definition: Normalize.hpp:52
Definition: UndirectedGraph.hpp:26
ext::vector< TEdge > predecessorEdges(const TNode &n) const override
Definition: UndirectedGraph.hpp:264
ext::map< TNode, ext::map< TNode, TEdge > > m_adjacency_list
Definition: UndirectedGraph.hpp:36
ext::set< TNode > successors(const TNode &n) const override
Definition: UndirectedGraph.hpp:229
bool addEdge(Params &&... params)
Definition: UndirectedGraph.hpp:178
void addNode(Params &&... params)
Definition: UndirectedGraph.hpp:136
size_t nodeCount() const override
Definition: UndirectedGraph.hpp:185
ext::set< TNode > getNodes() const override
Definition: UndirectedGraph.hpp:203
void addNode(TNode &&n)
Definition: UndirectedGraph.hpp:130
size_t edgeCount() const override
Definition: UndirectedGraph.hpp:190
ext::vector< TEdge > getEdges() const override
Definition: UndirectedGraph.hpp:214
const ext::map< TNode, ext::map< TNode, TEdge > > & getAdjacencyList() const &
Definition: UndirectedGraph.hpp:112
ext::vector< TEdge > successorEdges(const TNode &n) const override
Definition: UndirectedGraph.hpp:244
std::string name() const override
Definition: UndirectedGraph.hpp:271
ext::set< TNode > predecessors(const TNode &n) const override
Definition: UndirectedGraph.hpp:259
void addNode(const TNode &n)
Definition: UndirectedGraph.hpp:125
void operator>>(ext::ostream &ostream) const override
Definition: UndirectedGraph.hpp:278
bool addEdge(TEdge &&e)
Definition: UndirectedGraph.hpp:160
bool operator==(const UndirectedGraph &other) const
Definition: UndirectedGraph.hpp:57
bool addEdge(const TEdge &e)
Definition: UndirectedGraph.hpp:143
p second
Definition: ToRegExpAlgebraic.h:126
int i
Definition: AllEpsilonClosure.h:118
Definition: normalize.hpp:10
Definition: CapacityEdge.hpp:18
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
graph::UndirectedGraph< node::Node, edge::CapacityEdge< node::Node, int > > UndirectedGraph
Definition: FordFulkerson.hpp:26
Definition: ReconstructPath.hpp:14
static graph::UndirectedGraph eval(graph::UndirectedGraph< TNode, TEdge > &&value)
Definition: UndirectedGraph.hpp:306
Definition: normalize.hpp:13