Previous Page Next Page Contents

Network::topSort -- topological sorting of the nodes

Introduction

Network::topSort(G) computes a topological sorting of the network G, i.e., a numbering T of the nodes, such that T[i] < T[j] whenever there is an edge [i,j] in the network.

Call(s)

Network::topSort(G)

Parameters

G - network

Returns

a table of nodes.

Details

Example 1

>> Network([1,2,3,4],[[1,2],[2,4],[3,4]]):
   Network::topSort(%)
                                 table(
                                   4 = 4,
                                   2 = 3,
                                   3 = 2,
                                   1 = 1
                                 )
>> Network::topSort(Network::complete(3))
      Error: Network contains cycle [Network::topSort]

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000