24 package org.lightjason.agentspeak.action.builtin.graph;
26 import com.google.common.base.Function;
27 import edu.uci.ics.jung.algorithms.shortestpath.DijkstraShortestPath;
28 import edu.uci.ics.jung.graph.Graph;
31 import javax.annotation.Nonnull;
32 import java.util.List;
59 protected final Object
apply( @Nonnull
final List<ITerm> p_vertices, @Nonnull
final Graph<Object, Object> p_graph,
60 @Nonnull
final Function<Object, Number> p_weightfunction )
62 return new DijkstraShortestPath<>( p_graph, p_weightfunction )
63 .getDistance( p_vertices.get( 0 ).raw(), p_vertices.get( 1 ).raw() )
abstract class to define path / distance graph algorithms
static final long serialVersionUID
serial id
final Object apply( @Nonnull final List< ITerm > p_vertices, @Nonnull final Graph< Object, Object > p_graph, @Nonnull final Function< Object, Number > p_weightfunction)
calculates the distance of two vertices within each graph instance.