We study a general model of multi-dimensional screening for discrete types of consumers without the single-crossing condition or any other essential restrictions. Such generality motivates us to introduce graph theory into optimization by treating each combination of active constraints as a digraph. Our relaxation of the constraints (a slackness parameter) excludes bunching and cycles among the constraints. Then, the only possible solution structures are rivers, which are acyclic rooted digraphs, and the Lagrange multipliers can be used to characterize the solutions. Relying on these propositions, we propose and justify an optimization algorithm. In the experiments, its branch-and-bound version with a good starting plan shows fewer iterations than a complete search among all rivers.