As a side project, I am building a tool to visualize traffic flows between various points in a model "city" (to start with, I have a simple grid layout in mind) as a function of the layout. See how these flows vary if the residential/commercial areas are far apart v/s close by etc. What is the best way to study the underlying mathematics of it ?