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)
| 433 | |
| 434 | |
| 435 | private static <N, E> Map<N, Set<E>> nodeToIncidentEdges(final Network<N, E> graph) { |
| 436 | checkNotNull(graph, "graph"); |
| 437 | return Maps.asMap( |
| 438 | graph.nodes(), |
| 439 | new Function<N, Set<E>>() { |
| 440 | @Override |
| 441 | public Set<E> apply(N node) { |
| 442 | return graph.incidentEdges(node); |
| 443 | } |
| 444 | }); |
| 445 | } |
| 446 | |
| 447 | |
| 448 | private static <N> Map<N, Set<N>> nodeToAdjacentNodes(final Graph<N> graph) { |
no test coverage detected