[Graph] how to obtain the complement of a graph?

Given a graph G=(V,E) and its complete graph G'=(V,E'), what is the shortest code lines to obtain the complement of G_c=(V,E'-E) ?

On Sep 7, 2005, at 1:12 PM, Tzu-Chien Chiu wrote:
Given a graph G=(V,E) and its complete graph G'=(V,E'), what is the shortest code lines to obtain the complement of G_c=(V,E'-E) ?
I can't think of anything better than the obvious algorithm (untested
code):
void complement_graph(const Graph& g, Graph& gp)
{
typedef graph_traits<Graph>::vertex_descriptor vertex_descriptor;
std::map
participants (2)
-
Doug Gregor
-
Tzu-Chien Chiu