Previous Page Next Page Contents

Network::random -- generates a random network

Introduction

Network::random generates a random network.

Call(s)

Network::random()
Network::random(In,D,Kn)

Parameters

In - list with two integers
D - real number between 0 and 1
Kn - list with two integers

Returns

A Network

Details

Example 1

Your results may differ in the following example.

>> N1 := Network::random():
   Network::printGraph(N1[1])
                    Vertices: [1, 2, 3, 4, 5, 6, 7, 8]
      
      Edges: [[7, 2], [2, 7], [1, 3], [3, 1], [1, 2], [2, 1], [8, 4]\
      , [4, 8], [6, 5], [5, 6], [4, 6], [6, 4], [7, 3], [3, 7], [6, \
      7], [7, 6], [8, 2], [2, 8], [4, 3], [3, 4], [3, 6], [6, 3], [7\
      , 1], [1, 7], [6, 8], [8, 6], [5, 4], [4, 5], [2, 6], [6, 2], \
      [1, 4], [4, 1]]
      
          Vertex weights: table(8=0,7=0,6=0,5=0,4=0,3=0,2=0,1=0)
      
      Edge capacities: table([2, 8]=1,[8, 2]=1,[3, 7]=10,[7, 3]=10,[\
      6, 4]=7,[4, 6]=7,[4, 5]=4,[5, 4]=4,[6, 3]=1,[3, 6]=1,[2, 7]=4,\
      [7, 2]=4,[6, 2]=8,[2, 6]=8,[1, 7]=4,[7, 1]=4,[3, 4]=4,[4, 3]=4\
      ,[4, 1]=6,[1, 4]=6,[3, 1]=6,[1, 3]=6,[2, 1]=10,[1, 2]=10,[8, 6\
      ]=2,[6, 8]=2,[7, 6]=7,[6, 7]=7,[4, 8]=8,[8, 4]=8,[5, 6]=2,[6, \
      5]=2)
      
      Edge weights: table([2, 8]=1,[8, 2]=1,[3, 7]=1,[7, 3]=1,[6, 4]\
      =1,[4, 6]=1,[4, 5]=1,[5, 4]=1,[6, 3]=1,[3, 6]=1,[2, 7]=1,[7, 2\
      ]=1,[6, 2]=1,[2, 6]=1,[1, 7]=1,[7, 1]=1,[3, 4]=1,[4, 3]=1,[4, \
      1]=1,[1, 4]=1,[3, 1]=1,[1, 3]=1,[2, 1]=1,[1, 2]=1,[8, 6]=1,[6,\
       8]=1,[7, 6]=1,[6, 7]=1,[4, 8]=1,[8, 4]=1,[5, 6]=1,[6, 5]=1)
      
      Adjacency list (out): table(8=[4, 2, 6],7=[2, 3, 6, 1],6=[5, 4\
      , 7, 3, 8, 2],5=[6, 4],4=[8, 6, 3, 5, 1],3=[1, 7, 4, 6],2=[7, \
      1, 8, 6],1=[3, 2, 7, 4])
      
      Adjacency list (in): table(8=[4, 2, 6],7=[2, 3, 6, 1],6=[5, 4,\
       7, 3, 8, 2],5=[6, 4],4=[8, 6, 3, 5, 1],3=[1, 7, 4, 6],2=[7, 1\
      , 8, 6],1=[3, 2, 7, 4])

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000