def generate_output(shortest_path, starting_node, ending_node):
    """
    Generates the message to the user detailing the result of the 
    breadth first search to find the shortest path.
    """

    if shortest_path < 0:
        output_message = "Nodes {} and {} are not connected.".format(starting_node, ending_node)
    elif shortest_path == 0:
        output_message = "The shortest path is 0. If you're at home, you don't have to \
cross the street to get home!"
    else:
        output_message = "The shortest path between nodes {} and {} is {}.".format(starting_node, ending_node, shortest_path)

    return output_message