112 return c1.nombre ==
c2.nombre;
121 return p->get_info().nombre == nombre;
126 const string &
c1,
const string &
c2,
132 n1 =
mapa.insert_node(
c1);
137 n2 =
mapa.insert_node(
c2);
139 string nombre_arco = n1->get_info().nombre +
"--" + n2->get_info().nombre;
150 cout <<
itor.get_current_node()->get_info().nombre <<
"-";
174 cout << arc->get_info().nombre <<
" " << arc->get_info().distancia
181 <<
"Listado del grafo por nodos y en cada nodo por arcos"
187 cout << src_node->get_info().nombre <<
endl;
192 cout <<
INDENT << arc->get_info().distancia <<
" "
202 insert_via(g,
"San Cristobal",
"La Fria", 69);
203 insert_via(g,
"San Cristobal",
"Sacramento", 113);
204 insert_via(g,
"San Cristobal",
"San Antonio", 36);
207 insert_via(g,
"El Vigia",
"Santa Barbara", 59);
218 template <
typename GT>
248 cerr <<
"Error: buscar_ciudad(tree, \"Merida\") returned nullptr" <<
endl;
252 std::unique_ptr<Tree_Node<string>> t(
255 ofstream
test(
"prueba.Tree", ios::trunc);
258 cerr <<
"Error: could not open prueba.Tree for writing" <<
endl;
Generic directed graph (digraph) wrapper template.
bool has_curr() const noexcept
Return true if the iterator has current item.
Functor class to convert a tree graph to Tree_Node structure.
Iterator on the arcs of a graph.
Graph implemented with double-linked adjacency lists.
_Graph_Node Node
The graph type.
_Graph_Arc Arc
The node class type.
Iterator on nodes and arcs of a path.
Forward declaration used by CRTP helpers before the full node definition.
T & get_key() noexcept
Returns a modifiable reference to the node contents.
NodeInfo & get_info() noexcept
Return a modifiable reference to the data contained in the node.
Node * get_src_node(Arc *arc) const noexcept
Return the source node of arc (only for directed graphs)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
Node * get_connected_node(Arc *arc, Node *node) const noexcept
Return the adjacent node to node through arc.
constexpr size_t get_num_arcs() const noexcept
Node * get_tgt_node(Arc *arc) const noexcept
Return the target node of arc (only for directed graphs)
Tree visualization and output generation.
Convert spanning tree graphs to Tree_Node structures.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Arc of graph implemented with double-linked adjacency lists.
Node belonging to a graph implemented with a double linked adjacency list.
Iterator on all arcs of a graph.
bool operator()(const Ciudad &c1, const Ciudad &c2)
bool operator==(const Ciudad &c) const
Ciudad(const string &str)
void operator()(typename GT::Node *g, Tree_Node< string > *t)
static const Distance_Type Zero_Distance
Via(const string &nom, int d)
Distance_Type & get_distance()
const string operator()(Tree_Node< string > *p)
void imprimir_camino(Path< Mapa > &path)
void imprimir_mapa(Mapa &g)
List_Graph< Nodo_Ciudad, Arco_Via > Mapa
List_Digraph< Nodo_Ciudad, Arco_Via > Dimapa
Graph_Node< Ciudad > Nodo_Ciudad
Mapa::Node * buscar_ciudad(Mapa &mapa, const string &nombre)
Graph_Arc< Via > Arco_Via
void insert_via(Mapa &mapa, const string &c1, const string &c2, int distancia)
void construir_mapa(Mapa &g)
Generic graph and digraph implementations.