distance To
Computes the distance from the nearest source node as a Double.
The distance between neighboring devices is computed using the metric function and defaults to the hop-count metric.
Return
The computed Double distance to the closest source.
Parameters
The type used for neighbor identifiers.
True if this device is a source node; otherwise false.
A Field<ID, Double> providing edge weights to each neighbor. Defaults to hops().toDouble().
Maximum allowed hops before discarding paths. Defaults to Int.MAX_VALUE.
Computes the distance from the nearest source node within a specified range.
Starting from bottom at a source and up to top, distances between neighboring devices are computed using the metric function and accumulated via accumulateDistance.
Return
The computed Distance to the closest source.
Parameters
The type used for neighbor identifiers.
The comparable type representing path lengths.
True if this device is a source node; otherwise false.
The zero-distance value at a source.
The maximum allowed distance; incoming distances are clamped to this value.
A Field<ID, Distance> providing edge weights to each neighbor.
Maximum allowed hops before discarding paths. Defaults to Int.MAX_VALUE.
Reducer function to combine two distances.