<｜begin▁of▁sentence｜>### Instruction:
As a coffee roaster, you know the importance of maintaining a precise and efficient process to enhance the flavor, aroma, and quality of the coffee. Imagine you are tasked with accurately documenting the roasting parameters and profiles for a new blend of coffee. How would you represent this information in a system using a specialized tool, such as the igraph's write_dimacs function, to capture the sequential connections and edge capacities? In this scenario, your aim is to ensure that each stage of the roasting process is meticulously recorded, akin to vertices and edges, while also considering the intended source and target of the end product.
### Response:
import igraph as ig

# Create a directed graph
g = ig.Graph(directed=True)
# Add 5 vertices
for _ in range(5):
    g.add_vertex()
# Add edges with corresponding capacities
g.add_edges([(0, 1), (1, 2), (2, 3), (3, 4)])
g.es['capacity'] = [10, 20, 30, 40]

# Write the graph to a DIMACS file
output_file = 'output.dimacs'
g.write_dimacs(f=output_file, source=0, target=4, capacity=g.es['capacity'])
<|EOT|>
