<｜begin▁of▁sentence｜>### Instruction:
Given a directed acyclic graph with vertices 0, 1, 2, 3, 4 and edges from 0 to 1, 1 to 2, 2 to 3, and 3 to 4, can you apply the Sugiyama layout using igraph's 'layout_sugiyama' function to produce a layered graph layout while also obtaining an extended graph with dummy nodes that represent the additional edge bends required to maintain the layering?
### Response:
from igraph import Graph

# Create a directed graph
g = Graph([(0, 1), (1, 2), (2, 3), (3, 4)], directed=True)

# Optional: Define the layers for each vertex
layers = [0, 1, 2, 3, 4]

# Apply the Sugiyama layout
g_layout = g.layout_sugiyama(layers=layers, return_extended_graph=True)
extended_layout, extended_graph = g_layout

# Print layout coordinates for the original graph nodes
print(extended_layout.coords[:len(g.vs)])

# Optionally, display the graph using the layout
igraph.plot(extended_graph, layout=extended_layout, vertex_label=extended_graph.vs['name'], mark_groups=True)
<|EOT|>
