C Algorithms – Topological Sort

Let us say that the order relation that was defined the in introduction lesson was a partial one, for example: a1 < a0, a1 < a2 < a3. The problem is to determine a list of order, in which if ai < aj then ai will come before aj in the final sorted list . For example, our list could be : a1, a0, a2, a3 or a1, a2, a0, a3 or a1, a2, a3, a0 Any partial ordered list can be sorted topological. For a graph, a topological sort… Read More

C Algorithms – Graph Theory

The graph theory refers to the study of graphs. A graph is a mathematical object that captures the notion of connection. For example, you want to connect two or more dots that could be considered a graph. Leonhard Euler is the inventor of graph theory, as he tried to solve the known problem of the Seven Bridges of Konigsberg.The townspeople supposedly posed the question “Is it possible to take a walk through town, crossing each of the seven bridges just once, and ending up wherever you started?”A representation of the… Read More