
[c]TColors vertexColor(TVertex *vertex)
{
TEdge *edge;
edge = vertex->edges.first;
while ( edge ){
if ( edge->dest->color == clBlack )
return clWhite;
edge = edge->next;
}
return clBlack;
};
void makeColors(TGraph *graph, int start)
{
TVertex *vertex;
TEdge *edge;
vertex = searchVertex(graph, start);
vertex->visit = true;
edge = vertex->edges.first;
while ( edge ){
if ( !edge->dest->visit )
makeColors(graph, edge->dest->num);
edge = edge->next;
}
vertex->color = vertexColor(vertex);
if ( vertex->color == clBlack )
graph->black++;
};[/c]
Where it is my error?