def euclidean_dist_vec(y1, x1, y2, x2):
    """
    Calculate euclidean distances.

    Vectorized function to calculate the euclidean distance between two points
    or between arrays of points.

    Parameters
    ----------
    y1 : float or np.array of float
        first y coord
    x1 : float or np.array of float
        first x coord
    y2 : float or np.array of float
        second y coord
    x2 : float or np.array of float
        second x coord

    Returns
    -------
    dist : float or np.array of float
        distance or vector of distances from (x1, y1) to (x2, y2) in graph
        units
    """
    # euclid's formula
    dist = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
    return dist