zoukankan      html  css  js  c++  java
  • 流程图定义的迷惑(线不能不交叉?)

    这是定义好的流程图路由:
    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,
    可是这个矩阵也只是表明了层次关系而已。
    下面是我手工调整的结果。已经问了一些人了,看看下午是否会有结果?
  • 相关阅读:
    经典面试题目C语言
    论C语言中二级指针和二维数组之间的区别
    判断单链表中是否有环找到环的入口节点
    论decltype和auto的区别
    在ubuntu下安装opencv
    C中有关引用和指针的异同
    (四)关于读文件的结束的判别方法(EOF和feof)以及区别
    (三)论sizeof与strlen之间的区别
    (二)C语言文本流和二进制流的区别
    (一)C的编译,printf,规范化
  • 原文地址:https://www.cnblogs.com/juqiang/p/7805.html
Copyright © 2011-2022 走看看