Returns a map that is a live view of graph, with nodes as keys and the set of incident edges as values.
(final Network<N, E> graph)
| 415 | * and the set of incident edges as values. |
| 416 | */ |
| 417 | private static <N, E> Map<N, Set<E>> nodeToIncidentEdges(final Network<N, E> graph) { |
| 418 | checkNotNull(graph, "graph"); |
| 419 | return Maps.asMap(graph.nodes(), new Function<N, Set<E>>() { |
| 420 | @Override |
| 421 | public Set<E> apply(N node) { |
| 422 | return graph.incidentEdges(node); |
| 423 | } |
| 424 | }); |
| 425 | } |
| 426 | |
| 427 | private static <N> Map<N, Set<N>> nodeToAdjacentNodes(final Graph<N> graph) { |
| 428 | checkNotNull(graph, "graph"); |
no test coverage detected