@Ksharp's code looks good for finding one optimal solution. For LP, the number of optimal solutions can be 0, 1, or infinite. In your example, the entire line segment from (x1,x2) = (1,0) to (0,1) is optimal. The LP solver returns only one of these solutions.
... View more