Recent advances in representation theory lead to combinatorial problems involving convex polytopes and their piecewise-linear transformations. We will discuss some of these problems arising in the representation theory of quantum groups, affine Hecke algebras, quivers, etc. Unexpectedly, their solution uses concepts and methods from combinatorial optimization (flows in networks) and control theory (tropical semirings).