def solveMP(MP, xr, yr, d):
    """
    Get optimal solution and objective value for current master problem
    """
    # optimize
    MP.update()
    MP.optimize()
    MPobj = MP.objVal

    # get first-stage varibles
    xrsol_t = {}
    for u in d.users:
        for v in d.VMs:
            for p in d.providers:
                xrsol_t[u,v,p] = xr[u,v,p].x
    yrsol_t = {}
    for u in d.users:
        for r in d.routers:
            yrsol_t[u,r] = yr[u,r].x

    return xrsol_t, yrsol_t, MPobj