def extract_solution(solver):
    """
    Extracts the solution to the given LP solver, 
    returning a dictionary of variable names to values. 
    """
    solution = {}
    for var in solver.variables():
        solution[var.name()] = var.solution_value()

    return solution