Converting a schematic into a graph
When you design a circuit in a given CAD tool, your design is reduced to a list of nets called a... Netlist.  A netlist includes all the components and the nodes in your design.  A node is a conductor to which your components connect.  This makes sense when you think about the most basic representation of components and conductors.  The Former being an input and an output, and the later being a point (node).   

You've got your data model flipped around.  Your graph should represent common connections as nodes and your components as edges.  

This approach provides a more accessible data model when solving lumped element models.  Checkout Mr. Kirchhoff