  It is well known, due to Lindstr\"om, that the minors of a (real or complex)
matrix can be expressed in terms of weights of flows in a planar directed
graph. Another classical fact is that there are plenty of homogeneous quadratic
relations involving flag minors, or Pl\"ucker coordinates of the corresponding
flag manifold. Generalizing and unifying these facts and their tropical
counterparts, we consider a wide class of functions on $2^{[n]}$ that are
generated by flows in a planar graph and take values in an arbitrary
commutative semiring, where $[n]=\{1,2,\ldots,n\}$. We show that the
``universal'' homogeneous quadratic relations fulfilled by such functions can
be described in terms of certain matchings, and as a consequence, give
combinatorial necessary and sufficient conditions on the collections of subsets
of $[n]$ determining these relations.
