/***************************************************************************
vertex.h
-------------------
begin : Wed Sep 1 1999
copyright : (C) 1999 by Jan Meinke
email : meinke@bigfoot.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef VERTEX_H
#define VERTEX_H
#include <vector>
#include <list>
#include <algorithm>
#include "edge.h"
/** This class represents a vertex in a graph. It's mainly used as a reference
* object.
*
*@author Jan Meinke
*/
class Vertex {
public:
Vertex();
~Vertex();
/** Adds the given edge to outEdges if the origin
* of it is equal to this.
*/
void registerEdge(Edge* edge);
friend bool operator==(const Vertex& u, const Vertex& v){
return (&u == &v);
}
/** Removes the edge from the list of outgoing edges. This basically removes the
* edge from the graph.
*/
void unregisterEdge(Edge* e);
public: // Private attributes
/** Keeps track of the Edges originating in this
* vertex.
*/
list<Edge*> outEdges;
public: // Public attributes
/** Stores the predecessor vertex used in algorithms
* like Dijkstra's shortes path. */
Vertex* predecessor;
Vertex* predecessor2;
/** */
int distance;
int distance2;
/** Exess flow in the maximum flow algorithm. */
int e;
/** A flag for several algorithms that the current
* vertex has already been used. */
bool visited;
bool visited2;
/** */
bool inQueue;
};
#endif
| Generated by: meinke@orion on Mon May 8 18:18:46 2000, using kdoc 2.0a35. |