  We prove that the class of cluster integrable systems constructed by
Goncharov and Kenyon out of the dimer model on a torus coincides with the one
defined by Gekhtman, Shapiro, Tabachnikov, and Vainshtein using Postnikov's
perfect networks. To that end we express the characteristic polynomial of a
perfect network's boundary measurement matrix in terms of the dimer partition
function of the associated bipartite graph. Our main tool is flat geometry.
Namely, we show that if a perfect network is drawn on a flat torus in such a
way that the edges of the network are Euclidian geodesics, then the angles
between the edges endow the associated bipartite graph with a canonical
fractional Kasteleyn orientation. That orientation is then used to relate the
partition function to boundary measurements.
