流程图定义的迷惑(线不能不交叉?)

这是定义好的流程图路由:
0(Parent:receive order)--->1(Child:check finances)
1(Parent:check finances)--->2(Child:decline order)
1(Parent:check finances)--->9(Child:check stock)
3(Parent:R1)--->4(Child:check part. ship)
3(Parent:R1)--->5(Child:plan part. production)
4(Parent:check part. ship)--->6(Child:R2)
4(Parent:check part. ship)--->8(Child:plan full production)
5(Parent:plan part. production)--->6(Child:R2)
6(Parent:R2)--->7(Child:produce)
7(Parent:produce)--->11(Child:Notify partial shipment)
8(Parent:plan full production)--->7(Child:produce)
9(Parent:check stock)--->3(Child:R1)
9(Parent:check stock)--->8(Child:plan full production)
9(Parent:check stock)--->10(Child:Notify full shipment)
10(Parent:Notify full shipment)--->12(Child:Ship & Report)
11(Parent:Notify partial shipment)--->12(Child:Ship & Report)
我按照层次关系,把图画了出来,可惜,线的交叉非常多。也想不清,这个东西应该是一个算法的问题,还是一个design的问题?后来我抛弃了层次,修改成了这样,呵呵,效果是好了。可惜,想不清楚,代码中如何实现这种效果?!
我做了一个矩阵,结果如下:
 

0,1,0,0,0,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,1,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,1,0,1,0,0,0,0,
0,0,0,0,0,0,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,
0,0,0,1,0,0,0,0,1,0,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,
可是这个矩阵也只是表明了层次关系而已。
下面是我手工调整的结果。已经问了一些人了,看看下午是否会有结果?
posted @ 2004-04-27 13:06  鞠强  阅读(7796)  评论(6编辑  收藏  举报

hello

world