Structures_Graph
[ class tree: Structures_Graph ] [ index: Structures_Graph ] [ all elements ]

Class: Structures_Graph

Source Location: /Structures_Graph-1.0.4/Structures/Graph.php

Class Overview


The Structures_Graph class represents a graph data structure.


Author(s):

Copyright:

  • (c) 2004 by SÚrgio Carvalho

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
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.



[ Top ]


Method Detail

Structures_Graph (Constructor)   [line 76]

Structures_Graph Structures_Graph( [boolean $directed = true])

Constructor
  • Access: public

Parameters:

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

[ Top ]

addNode   [line 102]

void addNode( Structures_Graph_Node &$newNode)

Add a Node to the Graph
  • Access: public

Parameters:

Structures_Graph_Node   &$newNode     The node to be added.

[ Top ]

getNodes   [line 149]

array &getNodes( )

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

[ Top ]

isDirected   [line 89]

boolean isDirected( )

Return true if a graph is directed
  • Return: true if the graph is directed
  • Access: public

[ Top ]

removeNode   [line 136]

void removeNode( Structures_Graph_Node &$node)

Remove a Node from the Graph
  • Todo: This is unimplemented
  • Access: public

Parameters:

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

[ Top ]


Documentation generated on Tue, 26 Oct 2010 04:30:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.