Scénario de test & Cas d'usage
Network analysis and graph algorithms.
Discover all actions of optNetworkSimulation of a large graph with 50,000 random interactions to test performance and algorithm stability.
| 1 | |
| 2 | DATA mycas.social_graph; |
| 3 | call streaminit(12345); |
| 4 | DO i = 1 to 50000; |
| 5 | user_id_1 = int(rand('uniform') * 5000); |
| 6 | user_id_2 = int(rand('uniform') * 5000); |
| 7 | IF user_id_1 ne user_id_2 THEN OUTPUT; |
| 8 | END; |
| 9 | |
| 10 | RUN; |
| 11 |
| 1 | |
| 2 | PROC CAS; |
| 3 | SIMPLE.numRows TABLE={name='social_graph'}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | optNetwork.connectedComponents links={name='social_graph', vars={from='user_id_1', to='user_id_2'}} distributed=true algorithm='AFFOREST' nThreads=8 outNodes={name='user_communities', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
The execution must complete without memory errors. The 'user_communities' table should be populated with component IDs for all 5,000 users. The log should confirm that the 'AFFOREST' algorithm was used in a distributed manner.