<｜begin▁of▁sentence｜>### Instruction:
Given a graph with vertices and directed edges along with their respective capacities, how can you calculate the value of the maximum flow from a source vertex to a target vertex?
### Response:
from igraph import Graph

# Define the edges and the corresponding capacities for the graph
capacity = [10, 10, 10, 1, 6, 4]
edges = [(0, 1), (1, 2), (0, 2), (1, 3), (3, 4), (2, 4)]

# Create the graph with the defined edges and capacitiesg = Graph(edges=edges)
g.es['capacity'] = capacity

# Calculate the maximum flow value between vertex 0 (source) and vertex 4 (target)
max_flow_value = g.maxflow_value(source=0, target=4, capacity='capacity')
print('The value of the maximum flow from vertex 0 to 4 is:', max_flow_value)
<|EOT|>
