高分求一个算法或思路。 ( 积分: 300 )

  • 主题发起人 主题发起人 kiss2
  • 开始时间 开始时间
K

kiss2

Unregistered / Unconfirmed
GUEST, unregistred user!
fromId=100000000 toId=100000002
fromId=100000000 toId=104040000
fromId=100000000 toId=100010000
fromId=100000000 toId=106010000
fromId=100000000 toId=100000100
fromId=100000000 toId=100000200
fromId=100000000 toId=100000001
fromId=100000001 toId=100000000
fromId=100000002 toId=100000003
fromId=100000002 toId=100000000
fromId=100000003 toId=100000004
fromId=100000003 toId=100000002
fromId=100000003 toId=100000006
fromId=100000003 toId=100000006
fromId=100000004 toId=100000005
fromId=100000004 toId=100000003
fromId=100000005 toId=100000004
fromId=100000006 toId=100000003
fromId=100000100 toId=100000000
fromId=100000100 toId=100000200
fromId=100000100 toId=100000101
fromId=100000100 toId=100000102
fromId=100000100 toId=100000103
fromId=100000100 toId=100000104
fromId=100000100 toId=100000105
fromId=100000101 toId=100000100
fromId=100000102 toId=100000100
fromId=100000103 toId=100000100
fromId=100000104 toId=100000100
fromId=100000105 toId=100000100
fromId=100000200 toId=100000202
fromId=100000200 toId=100000000
fromId=100000200 toId=100000100
fromId=100000200 toId=100000201
fromId=100000200 toId=100000203
fromId=100000201 toId=100000200
fromId=100000202 toId=100000200
fromId=100000203 toId=100000200
fromId=100010000 toId=100000000
fromId=100010000 toId=100020000
fromId=100020000 toId=100010000
fromId=100020000 toId=100030000
fromId=100030000 toId=100030001
fromId=100030000 toId=100040000
fromId=100030000 toId=100020000
fromId=100030001 toId=100030000
fromId=100040000 toId=100040001
fromId=100040000 toId=100040001
fromId=100040000 toId=100040002
fromId=100040000 toId=100040002
fromId=100040000 toId=100040003
fromId=100040000 toId=100040004
fromId=100040000 toId=100040004
fromId=100040000 toId=100040100
fromId=100040000 toId=100030000
fromId=100040001 toId=100040000
fromId=100040001 toId=100040000
fromId=100040002 toId=100040000
fromId=100040002 toId=100040000
fromId=100040003 toId=100040000
fromId=100040004 toId=100040000
fromId=100040004 toId=100040000
fromId=100040100 toId=100040110
fromId=100040100 toId=100040101
fromId=100040100 toId=100040000
fromId=100040100 toId=100050000
fromId=100040101 toId=100040102
fromId=100040101 toId=100040102
fromId=100040101 toId=100040100
fromId=100040101 toId=100040103
fromId=100040102 toId=100040101
fromId=100040102 toId=100040101
fromId=100040103 toId=100040104
fromId=100040103 toId=100040104
fromId=100040103 toId=100040104
fromId=100040103 toId=100040101
fromId=100040103 toId=100040105
fromId=100040104 toId=100040103
fromId=100040104 toId=100040103
fromId=100040104 toId=100040103
fromId=100040105 toId=100040106
fromId=100040105 toId=100040103
fromId=100040106 toId=100040105
fromId=100040110 toId=100040100
fromId=100050000 toId=100040100
fromId=100050000 toId=101000000
fromId=101000000 toId=101000200
......还有很多
-----------------------------------
从以上中找出最短的路径,比如fromId=100000000,toId=100000202,则路径为:
fromId=100000000 toId=100000200
fromId=100000200 toId=100000202

比如fromId=100000000,toId=100040100,则路径为:
fromId=100000000 toId=100010000
fromId=100010000 toId=100020000
fromId=100020000 toId=100030000
fromId=100030000 toId=100040000
fromId=100040000 toId=100040100


请各位给点思路?
 
1.分两类fromId toId
2.各自取出所有类的数据到一变体数组
3.用多线程排序
4.然后删除重复
5.处理显示结果
 
好深奥啊?具体要怎么做好哦?[:(]
 
你说的是给思路 要写代码要看具体情况啦 你的这些100040000在你的程序中是integer类型还是string类型还是保存在文本里的?
 
保存在memo1里的text类型的
 
我觉得可以把所有的点放到图的结构中,再在图中找最短路径就简单多了
 
后退
顶部