One of the application I created a prototype for at work collects surveys which patients fill out. An example of a simple survey question with “branching” requirement can be related to gender. Based on that answer, only related sub questions should be posed. In order to model this dynamically(vs hard coding a survey), I had to revisit a topic from discrete math, specifically the concept of a directed graph. By implementing the underlying logic using a graph, a generic approach can be used to guide a user to fill out a survey for only relevant questions. There are many other use cases where graphs drive the underlying application logic (GPS, Neuroscience, Bayesian Networks, Supply Chain, etc..) and it’s up to you as the engineer to decide on the appropriate application.
Below is a short demo of the graph examples I have created:
Code via GITHUB