Sub topic 15
When Mesh Analysis Does Not Apply: Nonplanar Circuits
This chapter assumes you can write mesh equations (see the earlier chapters), count nodes and branches, and solve a small linear system. It explains why mesh analysis needs a planar circuit, how to test for that, and what to use when the test fails.
What "planar" means
A circuit is planar if you can draw it on a flat sheet so that no branch crosses another branch except at a node. Mesh analysis relies on this. A mesh is a loop with no other loop inside it, which means a window in the drawing. The mesh currents are the currents circulating around those windows.
Planarity is a property of how the elements connect, not of how the drawing looks. Two things follow from that:
- A drawing with crossing wires can still be planar. If you can slide the elements around until the crossings disappear, the circuit is planar, and mesh analysis applies.
- A crossing with no dot is not a connection. A crossing with a dot is a node. Decide which one you have before you count anything.
Mesh analysis needs the windows to exist. In a planar circuit they do, and each one is a mesh. In a nonplanar circuit, every drawing has at least one crossing that cannot be removed, so there is no set of windows to assign currents to.
Counting meshes and independent loops
For a connected circuit with n nodes and b branches, the number of independent KVL equations is b - n + 1. Each independent equation uses at least one branch that no earlier equation used.
For a planar circuit, Euler's formula says n - b + f = 2, where f counts the faces of the drawing, including the outer region. The meshes are the inner faces, so:
meshes = f - 1 = b - n + 1
So for planar circuits, the number of meshes equals the number of independent KVL equations. For nonplanar circuits, the count b - n + 1 is still valid, but no set of windows supplies the loops.
| Quantity | Formula | Applies to |
|---|---|---|
| Independent KVL equations | b - n + 1 | Any connected circuit |
| Independent KCL equations | n - 1 | Any connected circuit |
| Meshes (windows) | b - n + 1 | Planar circuits only |
Recognizing a nonplanar circuit
Kuratowski's theorem gives an exact test. A graph is nonplanar if and only if it contains a subdivision of one of two graphs:
- K5: five nodes, with a branch between every pair (10 branches).
- K3,3: six nodes in two groups of three, with a branch from every node in one group to every node in the other (9 branches).
A subdivision means you may insert extra nodes along branches. That covers series resistors, so adding series elements never makes a nonplanar circuit planar. Parallel branches do not change planarity either.
Some circuits that look complicated are planar:
- The Wheatstone bridge has four nodes with a branch between every pair, which is K4. It is planar, and it has three meshes.
- A cube of 12 resistors is planar. Draw one square inside another and join the corners.
Nonplanar circuits are uncommon in textbooks. They do occur in real hardware. Multilayer boards and integrated circuits can route one conductor over another, so a physical crossing does not force a connection.
An example: K3,3 with unit resistors
Take six nodes, three in group A and three in group B. Connect every A node to every B node with a 1 Ω resistor. This circuit has n = 6 and b = 9.
- Independent KVL equations: 9 - 6 + 1 = 4.
- Independent KCL equations: 6 - 1 = 5.
You cannot draw four windows for this circuit, so there are no meshes. You can still write four independent KVL equations, but you must choose the loops some other way (see the next section).
The nodal approach works directly. Inject 1 A into one node, take 1 A out of an adjacent node, and ground the node where the current leaves. The voltage at the injection node is then the equivalent resistance between the two nodes.
A check is available. Foster's theorem says that for a network of unit resistors, the equivalent resistances across all the branches add up to n - 1. K3,3 is edge-transitive, which means every branch looks the same from the outside, so every branch has the same equivalent resistance. Therefore each equals 5/9 Ω ≈ 0.5556 Ω.
The code below tests planarity for several graphs and computes that value by nodal analysis. It needs numpy and networkx. Install them with pip install numpy networkx.
import networkx as nx
import numpy as np
graphs = {
"K4 (Wheatstone bridge)": nx.complete_graph(4),
"Cube": nx.hypercube_graph(3),
"K5": nx.complete_graph(5),
"K3,3": nx.complete_bipartite_graph(3, 3),
}
for name, g in graphs.items():
planar, _ = nx.check_planarity(g)
n, b = g.number_of_nodes(), g.number_of_edges()
print(f"{name}: n={n}, b={b}, independent loops={b - n + 1}, planar={planar}")
# Nodal analysis of K3,3 with 1-ohm resistors.
g = nx.complete_bipartite_graph(3, 3)
n = g.number_of_nodes()
L = nx.laplacian_matrix(g, nodelist=range(n)).toarray().astype(float) # conductance matrix, G = 1 S per branch
source_node, sink_node = 0, 3 # nodes 0 and 3 are in different groups, so they are adjacent
current = np.zeros(n)
current[source_node] = 1.0 # 1 A injected at node 0 (the sink node is the reference)
keep = [k for k in range(n) if k != sink_node] # ground the sink node
v = np.linalg.solve(L[np.ix_(keep, keep)], current[keep])
print(f"R_eq between adjacent nodes = {v[0]:.4f} ohm (expected 5/9 = {5/9:.4f})")The output reports K4 and the cube as planar, K5 and K3,3 as nonplanar, and an equivalent resistance of 0.5556 Ω.
What to do instead
You have three practical options.
- Nodal analysis. It never needs a drawing. It needs
n - 1equations, and it works for any connected circuit. This is the simplest fix. - Loop analysis with fundamental loops. Choose a spanning tree, which is a set of
n - 1branches that connects every node without forming a loop. Each remaining branch, called a link, closes exactly one loop with the tree. That givesb - n + 1independent loops, and you write KVL around each one. The equations take the same matrix form as mesh equations. The difference is that some loops share branches in less obvious ways, so you must track the shared branches by hand. - Modified nodal analysis in software. Circuit simulators use this method for general circuits, planar or not. It handles voltage sources and dependent sources by adding extra unknowns.
Edge cases
- Disconnected circuits. If a circuit has
pseparate parts, the independent loop count isb - n + p. Analyze each part separately. - Mutual coupling or three-terminal devices. Elements such as transistors or transformers can complicate the graph. Model them with equivalent circuits built from two-terminal elements and dependent sources, then test planarity on the result.
- Supermeshes and dependent sources. These tools belong to mesh analysis. In a nonplanar circuit you would handle current sources in the loop or nodal method by the same constraint idea: a current source fixes one loop current or one branch current, so one unknown is removed.
- A planar circuit with one awkward crossing. Try redrawing it before switching methods. Many circuits that look nonplanar are planar.
Exercise
A circuit has 6 nodes and 9 branches, and it is a K3,3 graph. (a) How many independent KVL equations does it have? (b) How many independent KCL equations? (c) Can you write mesh equations for it? Explain.
Show answer
(a) b - n + 1 = 9 - 6 + 1 = 4. (b) n - 1 = 5. (c) No. K3,3 is nonplanar, so it cannot be drawn without crossing branches. It has no windows, so it has no meshes. You can still write four independent loop equations from a spanning tree, or five nodal equations.
Exercise
A connected planar circuit has 8 branches and 5 nodes. How many meshes does it have, and which method needs fewer equations, mesh or nodal?
Show answer
Meshes = b - n + 1 = 8 - 5 + 1 = 4. Nodal analysis needs n - 1 = 4 equations. Both need 4, so the choice depends on the sources. Voltage sources favor mesh analysis, and current sources favor nodal analysis.