def run_dqm_and_collect_solutions(dqm, sampler):
    """ Send the DQM to the sampler and return the best sample found."""

    # Initialize the solver
    print("\nSending to the solver...")
    
    # Solve the DQM problem using the solver
    sampleset = sampler.sample_dqm(dqm, label='Example - Immunization Strategy')

    # Get the first solution
    sample = sampleset.first.sample

    return sample