[Haskell-beginners] kind of path search

Olivier Scalbert olivier.scalbert at algosyn.com
Tue Jan 15 21:30:27 CET 2013


Hello,

I am a beginner in Haskell and in functional programming.

Here is the problem I want to solve with Haskell.
I am sure that this fascinating language can do it !!!!

Suppose I have N nodes: node1, node, ..., nodeN
At each node I have a subset of values taken from [v1, v2, ..., vk].

For exemple:
node1 : [v1, v3]
node2 : [v2, V5, v6]
node3 : [v2, v3]

I have also a directed graph. From a value you can go to other values.
    v1 -> v5
    v1 -> v6

    v2 -> v1
    v2 -> v2

    v3 -> v2

    v6 -> v2

Now, I want to get all the paths from node1, to nodeN, following the 
node values and the graph.

node1.v1 -> node2.v6 -> node3.v2 is a path.
node1.v3 -> node2.v2 -> node3.v2 is also a path.

My problem size: N around 1000 and each node has 3 to 4 values taken 
from [1..10].

Thanks for your help !!!

Olivier



More information about the Beginners mailing list