Click here to Skip to main content
15,886,077 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when I have the Matrix below

          X1	 X2	 X3	 X4
Y1	1.00	0.11	0.07	0.50
Y2	0.22	0.07	0.30	0.14
Y3	0.00	0.06	0.06	0.08

how can I print all following path with java
X1Y1-> X2Y2-> X3Y3
            -> X4Y3
        X3Y2-> X2Y3
            -> X4Y3
        X4Y2-> X2Y3
            -> X3Y3
 X2Y1-> X1Y2-> X3Y3
            -> X4Y3
        X3Y2-> X1Y3
            -> X4Y3
        X4Y2-> X1Y3
            -> X3Y3
 X3Y1-> X1Y2-> X2Y3
            -> X4Y3
        X2Y2-> X1Y3
            -> X4Y3
        X4Y2-> X1Y3
            -> X2Y3

 X4Y1-> X1Y2-> X2Y3
            -> X3Y3
        X2Y2-> X1Y3
            -> X3Y3
        X1Y2-> X2Y3
            -> X3Y3


I try to do that by using Dijkstra's algorithm that can give me shorted paths.
But for my work I need to look all possible path except duplicate column that show in an above example. How can I do that???.Please help me!!! Due to my deadline.
But I have no idea :(
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900