Matching Graphs to Quadratic Equations