NNC: Neural-Network Control of Dynamical Systems on Graphs