The class Max (r,2)-CSP, or simply Max 2-CSP, consists of constraint satisfaction problems with at most two r-valued variables per clause. For instances with n variables and m binary clauses, we present an O(nr5+19m/100)-time algorithm which is the fastest polynomial-space algorithm for many problems in the class, including Max Cut. The method also proves a treewidth bound tw(G)≤(13/75 + o(l))m, which gives a faster Max 2-CSP algorithm that uses exponential space: running in time O*(2(13/75+o(l))m), this is fastest for most problems in Max 2-CSP. Parametrizing in terms of n rather than m, for graphs of average degree d we show a simple algorithm running time O*(2(1−(2/(n+1))m), the fastest polynomial-space algorithm known. In combination with ‘Polynomial CSPs’ introduced in a companion paper, these algorithms also allow (with an additional polynomial factor overhead in space and time) counting and sampling, and the solution of problems like Max Bisection that escape the usual CSP framework. Linear programming is key to the design as well as the analysis of the algorithms.