def decodeVarName(varName):
    """Given an LP variable name, extracts the sid and gid"""
    try:
        parts = varName.split('_')
        return (int(parts[1]), int(parts[2]))
    except IndexError:
        return None