namespace NGraph

Overview

A mathematical graph object: a simple, directed, connected graph, where nodes are of arbitrary type (colores, cities, names, etc.)

Operations for adding and removing edges and vertices, together with functions for finding neighbors, subgraphs, and other properties are included. More…

namespace NGraph {

// typedefs

typedef tGraph<unsigned int> Graph;
typedef tGraph<int> iGraph;
typedef tGraph<std::string> sGraph;

// classes

template <typename T>
class tGraph;

// global functions

template <typename T>
std::istream& operator >> (std::istream& s, tGraph<T>& G);

template <typename T>
std::ostream& operator << (
    std::ostream& s,
    const tGraph<T>& G
);

} // namespace NGraph

Detailed Documentation

A mathematical graph object: a simple, directed, connected graph, where nodes are of arbitrary type (colores, cities, names, etc.)

Operations for adding and removing edges and vertices, together with functions for finding neighbors, subgraphs, and other properties are included.

Example:

enum color {blue, green, red, yellow, pink, black};
tGraph<color> A;
A.insert_edge(blue, red);
A.insert_edge(yellow, blue);
A.insert_edge(blue, black);
tGraph<color> B(A), S=A.subgraph(blue);