Scénario de test & Cas d'usage
Network analysis and graph algorithms.
Discover all actions of optNetworkCreation of a supply chain graph including self-links (Warehouse A shipping to Warehouse A) and disjointed paths.
| 1 | |
| 2 | DATA mycas.logistics; |
| 3 | INPUT |
| 4 | SOURCE $ dest $ distance; |
| 5 | DATALINES; |
| 6 | FACT_1 WARE_A 100 WARE_A STORE_1 50 STORE_1 STORE_1 0 FACT_2 FACT_2 0 FACT_3 WARE_B 200 ; |
| 7 | |
| 8 | RUN; |
| 9 |
| 1 | |
| 2 | PROC CAS; |
| 3 | optNetwork.connectedComponents links={name='logistics', vars={from=' |
| 4 | source', to='dest'}} direction='DIRECTED' selfLinks=true outNodes={name='network_integrity', replace=true} out={name='integrity_summary', replace=true}; |
| 5 | |
| 6 | RUN; |
| 7 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.fetch TABLE={name='network_integrity', where='node in ("STORE_1", "FACT_2")'}; |
| 4 | |
| 5 | RUN; |
| 6 |
The action should successfully process the graph as directed. Nodes with self-links (STORE_1, FACT_2) should be included in the results and assigned valid component IDs, proving that `selfLinks=true` functioned correctly. The result distinguishes between the weakly connected sub-graphs.