I have to do a DC circuit builder application, something like this or this. I did all the building logic but I dont know how to analyze the generated circuit. The circuit is represented in memory as a graph in which each node is a circuit element (light bulb, resistor..) and I want to know the current through each side to light the bulb if necessary. There's a library in Java that can do this? Or any algorithm? Or someone can explain me how to solve the problem?
I know I have to find the circuit loops (graph loops) and apply Ohm's law, but some loops will share some circuit elements and I can not figure out what to do next.