除了重复列#javacode之外,如何在矩阵中打印所有可能的路径 [英] How do I print all possible path in matrix except duplicate column # javacode
本文介绍了除了重复列#javacode之外,如何在矩阵中打印所有可能的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我有以下矩阵
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
如何用java打印以下所有路径
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
我尝试使用Dijkstra的算法来做到这一点,它可以给我短路径。
但是对于我的工作我需要查看所有可能的路径,除了上面示例中显示的重复列。我怎么能这样做???。请帮帮我!!!由于我的截止日期。
但我不知道:(
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 :(
推荐答案
这篇关于除了重复列#javacode之外,如何在矩阵中打印所有可能的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文