def run_cqm_and_collect_solutions(cqm, sampler):
    """Send the CQM to the sampler and return the best sample found.
    Args:
        cqm (ConstrainedQuadraticModel): The CQM for our problem
        sampler: The CQM sampler to be used. Must have sample_cqm function.
    
    Returns:
        dict: The first feasible solution found
    """

    # Initialize the solver
    print("\nSending to the solver...")
    
    # Solve the CQM problem using the solver
    sampleset = sampler.sample_cqm(cqm, label='Example - Graph Partitioning')

    feasible_sampleset = sampleset.filter(lambda row: row.is_feasible)

    # Return the first feasible solution
    if not len(feasible_sampleset):
        print("\nNo feasible solution found.\n")
        return None

    return feasible_sampleset.first.sample