# Docs For Class Structures_Graph

## Class Structures_Graph

Description

The Structures_Graph class represents a graph data structure.

A Graph is a data structure composed by a set of nodes, connected by arcs. Graphs may either be directed or undirected. In a directed graph, arcs are directional, and can be traveled only one way. In an undirected graph, arcs are bidirectional, and can be traveled both ways.

- copyright: (c) 2004 by Sérgio Carvalho
- author: Sérgio Carvalho <mailto:sergio.carvalho@portugalmail.com>

Located in /Structures/Graph.php (line 56)

Method Summary
Structures_Graph Structures_Graph ([boolean $directed = true])
void addNode (Structures_Graph_Node &$newNode)
array &getNodes ()
boolean isDirected ()
void removeNode (Structures_Graph_Node &$node)
Methods
Constructor Structures_Graph (line 76)

Constructor

- access: public

Structures_Graph Structures_Graph ([boolean $directed = true])

- boolean $directed: Set to true if the graph is directed. Set to false if it is not directed. (Optional, defaults to true)

addNode (line 102)

Add a Node to the Graph

- access: public

void addNode (Structures_Graph_Node &$newNode)

- Structures_Graph_Node &$newNode: The node to be added.

getNodes (line 151)

Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.

- return: The set of nodes in this graph
- see: Structures_Graph_Manipulator_TopologicalSorter
- access: public

array &getNodes ()
isDirected (line 89)

Return true if a graph is directed

- return: true if the graph is directed
- access: public

boolean isDirected ()
removeNode (line 138)

Remove a Node from the Graph

- access: public
- todo: This is unimplemented

void removeNode (Structures_Graph_Node &$node)

- Structures_Graph_Node &$node: The node to be removed from the graph

Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by phpDocumentor 1.2.3