The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
350340 (1) [Avatar] Offline
There is a undirected graph with 10 vertexs and several edges, and each vertex has an initial value of 0 or 1. Now for each vertex, if the value of all it's

neighborhood is 1, then it's value of next state will be 1, and 0 otherwise. After computing every vertex in the graph, the value of all vertexs will be updated

simultaneously, and so on.

Would you give me some codes, especially the how to write the "compute" method ?