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

Class: Structures_Graph

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

Class Overview


The Structures_Graph class represents a graph data structure.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 53]
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 87]

void Structures_Graph( [boolean $directed = true])

Old constructor (PHP4-style; kept for BC with extending classes)
  • Access: public

Parameters:

boolean   $directed   —  Set to true if the graph is directed. Set to false if it is not directed.

[ Top ]

__construct (Constructor)   [line 74]

Structures_Graph __construct( [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.

[ Top ]

addNode   [line 109]

void addNode( &$newNode, Structures_Graph_Node $newNode)

Add a Node to the Graph
  • Access: public

Parameters:

Structures_Graph_Node   $newNode   —  The node to be added.
   &$newNode   — 

[ Top ]

getNodes   [line 171]

array &getNodes( )

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

[ Top ]

isDirected   [line 97]

boolean isDirected( )

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

[ Top ]

removeNode   [line 160]

void removeNode( &$node, 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
   &$node   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:02:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.