<｜begin▁of▁sentence｜>### Instruction:
As a network engineer, you've been given the task to find the shortest path from a specific location to another in a network. You need to use the A-Star algorithm with a Manhattan distance heuristic to calculate the shortest path to a destination. The network is represented as a weighted directed graph, and each node has 'x' and 'y' attributes that represent coordinates. The graph data can be read from a file named 'graph_example.gml'.
### Response:
import igraph as ig

# Read the graph from a file
g = ig.read('graph_example.gml')

# Define the heuristic function for A-Star
heuristic = lambda graph, from_vertex, to_vertex: abs(graph.vs[from_vertex]['x'] - graph.vs[to_vertex]['x']) + abs(graph.vs[from_vertex]['y'] - graph.vs[to_vertex]['y'])

# Calculate A-Star shortest path from vertex 0 to vertex 4
path = g.get_shortest_paths_astar(0, to=4, heuristic=heuristic, weights='weight', mode='all', output='vpath')

# Print the path (list of vertex indices)
print(path)
<|EOT|>
