optNetwork cycle

Manufacturing: Infinite Loop Detection in Large Processes

Scénario de test & Cas d'usage

Business Context

A car manufacturer wants to validate the Bill of Materials (BOM) for a new vehicle. With thousands of parts, they must ensure no process inadvertently waits for itself (Infinite Loop) causing production halts. The graph is large, requiring performance controls.
About the Set : optNetwork

Network analysis and graph algorithms.

Discover all actions of optNetwork
Data Preparation

Simulation of a large production line (1000 steps) with a forced massive loop (Step 1000 loops back to Step 1).

Copied!
1 
2DATA mycas.production_flow;
3LENGTH process_id next_id $10;
4DO i=1 to 1000;
5process_id = "Step_"||strip(put(i,best.));
6next_id = "Step_"||strip(put(i+1,best.));
7OUTPUT;
8END;
9process_id="Step_1001";
10next_id="Step_1";
11OUTPUT;
12 
13RUN;
14 

Étapes de réalisation

1
Execution with time constraints (maxTime) to prevent system hang if the graph is too complex.
Copied!
1 
2PROC CAS;
3optNetwork.cycle RESULT=r STATUS=s / direction="DIRECTED" links={name="production_flow"} linksVar={from="process_id", to="next_id"} maxTime=60 timeType="REAL" out={name="ProductionLoops", replace=true};
4 
5RUN;
6 

Expected Result


The action successfully identifies the large loop within the 60-second limit. The 'solutionStatus' in the results should indicate 'OK' or 'TIME_LIMIT_REACHED' if the graph was too large, but a result must be returned.