<｜begin▁of▁sentence｜>### Instruction:
Imagine you're the principal of an innovative educational academy, and you're overseeing a new initiative to streamline the distribution of resources across various departments. You've mapped out a system where 'x' represents your main administrative office and 'y' the central resource repository. The connecting departments, 'a', 'b', 'c', 'd', and 'e', each have varying capacities to handle resources, as follows: the administrative office ('x') can distribute 3 units to department 'a' and 1 unit to department 'b'. In turn, department 'a' can pass along 3 units to 'c', while 'b' can send 5 units to 'c' and 4 units to 'd'. Moreover, 'd' has the capacity to forward 2 units to 'e', and 'e' can send 3 units to the central resource repository ('y'). Additionally, 'c' can supply 2 units directly to repository 'y'.

Employing this abstract model of your academy's resource distribution network, you seek to calculate the maximum amount of resources that can effectively flow from the administrative office ('x') to the central repository ('y'). Also, you wish to understand the allocation of resources through each connecting departmental route. How would you go about obtaining this insight using NetworkX, a tool known for its prowess in network analysis?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add edges with capacity
G.add_edge('x', 'a', capacity=3.0)
G.add_edge('x', 'b', capacity=1.0)
G.add_edge('a', 'c', capacity=3.0)
G.add_edge('b', 'c', capacity=5.0)
G.add_edge('b', 'd', capacity=4.0)
G.add_edge('d', 'e', capacity=2.0)
G.add_edge('c', 'y', capacity=2.0)
G.add_edge('e', 'y', capacity=3.0)

# Compute the maximum flow from 'x' to 'y'
flow_value, flow_dict = nx.maximum_flow(G, 'x', 'y')

print('Maximum flow value:', flow_value)
print('Flow through edges:')
for edge in flow_dict:
    for adjacent_vertex in flow_dict[edge]:
        print(edge, '-', adjacent_vertex, ':', flow_dict[edge][adjacent_vertex])
<|EOT|>
