<｜begin▁of▁sentence｜>### Instruction:
As a biologist analyzing ecological networks, you have a dataset containing information about the flow of resources through different components of an ecosystem. This dataset is represented as a directed graph with 5 nodes and 7 edges, where each edge corresponds to a specific pathway for resource flow and has an associated capacity, representing the maximum flow it can support. To document this network, you want to write it to a file in DIMACS format, with the source node identified as 0 and the target node as 4. This will allow you to further analyze and visualize the flow of resources within the ecosystem.
### Response:
import igraph as ig

# Create a graph with 5 vertices and 7 edges
edges = [(0, 1), (0, 2), (0, 3), (1, 2), (2, 3), (3, 4), (4, 0)]
capacities = [10, 5, 15, 10, 5, 15, 10]

# Make a graph object
G = ig.Graph(edges=edges)

# Assign capacities to each edge
G.es['capacity'] = capacities

# Write the graph to a DIMACS file
G.write_dimacs(f='max_flow_problem.dimacs', source=0, target=4, capacity='capacity')
<|EOT|>
