We add checking during the propagation step of previous algorithm. When propagating,we remember the propagating path, so before handling one link,we check the node,if it is already in the path and we are changing the original propagation condition in that node.we know there is one cycle. So we stop here and report this information to user and let him check it.
So the revised algorithm would be:
step1: from the root node initialize the begin() and end() of each node according
to rule one and two, ignoring synchronization links now.
step2: Mark each synchronization link "0";
step3:
3.1) select one "0" marked syncronization link a--->b , mark it "1" and
compute the begin(a),end(a),begin(b),end(b) according to rule 1),2) and 3).
3.2) Then, we need to propagate this change to all the members in the hypergraph.
check if the node is already in the propagation path if so, stop,output the whole
path. if not add it to the propagation path;
กก
Add all synchronization links from a if begin(a) or end(a) has been changed and
the time value change will cause value change of the other node in the link(i.e.
It is in the right part of " <-- ") according to rules (3) to set S1;
Add all synchronization links from b if begin(b) or end(b) has been changed and
the time value change will cause value change of the other node in the link(i.e.
It is in the right part of " <-- ") according to rules (3) to set S2;
S0=S1+S2={link_1,link_2,...link_k};
check each link in s, if it is marked as "0", delete it;
S={link_i| link_i is in S0 and link_i is marked as "1"};
according to rule 1) and 2), begin() and end() will not only be modified by
synchronization links,but also by attachment links and annotation links.
So we also add attachment links and annotation links of a and(or) b(if its
begin and end value has been changed and the time value changed is in the right
part of the rules in (1) and (2)) to S;
If S is empty, stop! and delete this node from propagation path;
else For each link a-->b in S,compute the time vlaue of b from a And
recursivly call 3.2).
after all the links in S have been handled, delete this node from propagation path;
3.3) repeat 3.1) and 3.2) until all synchronization links have been marked "1";
กก
กก