[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Structures/Graph/Manipulator/ -> TopologicalSorter.php (sommaire)

This file contains the definition of the Structures_Graph_Manipulator_TopologicalSorter class.

Poids: 153 lignes (7 kb)
Inclus ou requis: 1 fois
Référencé: 3 fois
Nécessite: 4 fichiers
 Structures/Graph/Node.php
 PEAR.php
 Structures/Graph/Manipulator/AcyclicTest.php
 Structures/Graph.php

Définit 1 class

Structures_Graph_Manipulator_TopologicalSorter:: (3 méthodes):
  _nonVisitedInDegree()
  _sort()
  sort()


Classe: Structures_Graph_Manipulator_TopologicalSorter  - X-Ref

The Structures_Graph_Manipulator_TopologicalSorter is a manipulator
which is able to return the set of nodes in a graph, sorted by topological
order.

A graph may only be sorted topologically iff it's a DAG. You can test it
with the Structures_Graph_Manipulator_AcyclicTest.

_nonVisitedInDegree(&$node)   X-Ref
This is a variant of Structures_Graph::inDegree which does
not count nodes marked as visited.

return: integer     Number of non-visited nodes that link to this one

_sort(&$graph)   X-Ref


sort(&$graph)   X-Ref
sort returns the graph's nodes, sorted by topological order.

The result is an array with
as many entries as topological levels. Each entry in this array is an array of nodes within
the given topological level.

return: array     The graph's nodes, sorted by topological order.



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7