first idea:

    G =:|: 2 22$ 0 1 2 2 3 4 4 5 5 6 7  7  8  9 10 10 11 11 11 12 12 12 1 2 3 4 
5 6 5 7 8 7 9 10 10 11 12 11 13 14 15 16 15 14

    path0 =: 4 : '((+/"1  ( {:"1 y) =/ {."1 x)#y),.>  ,&.>/ (( {:"1 y) =/ {."1 
x)(#&.(>"1)) "1 _ {:"1 x '

    G path0^:8 ,0

0 1 2 3 5 7  9 11 13

0 1 2 3 5 7  9 11 14

0 1 2 3 5 7  9 11 15

0 1 2 3 5 7 10 12 16

0 1 2 3 5 7 10 12 15

...

2 problems remain:

the length of the paths should not be known in advance. For G all path 
have length 9.
path0 removes all ending paths.

if the graph contains circles or is an undirected graph edges that have 
been used in the path are to be avoided.

Greetings,

Markus


Am 24.04.2012 12:58, schrieb Markus Schmidt-Gröttrup:
> I have not investigated in finding an expression for all paths.
> What for? Efficient graph algorithms as Dijkstra shortest path
> algorithms avoid the flood of these possibilities.
>
> Could you  give an idea, what are you aiming at? (Beside staying young)
>
> Greetings,
>
> Markus
>
> Am 24.04.2012 12:39, schrieb R.E. Boss:
>    
>> Given the directed graph G (see<http://www.jsoftware.com/jwiki/RE%20Boss>   
>> http://www.jsoftware.com/jwiki/RE%20Boss) by its edges
>>
>>
>>
>>      |: G
>>
>> 0 1 2 2 3 4 4 5 5 6 7  7  8  9 10 10 11 11 11 12 12 12
>>
>> 1 2 3 4 5 6 5 7 8 7 9 10 10 11 12 11 13 14 15 16 15 14
>>
>>
>>
>> determine all (different) paths from root 0 to the leaves.
>>
>>
>>
>> This took me quite some time(days!). Am I getting old?
>>
>>
>>
>>
>>
>> R.E. Boss
>>
>>
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>
>>      
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
>    

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to