<｜begin▁of▁sentence｜>### Instruction:
As a human resources manager, you have been tasked with organizing and coordinating a team training program for employees of a company. The company operates in the field of network connectivity and wants to visualize a linear graph representing the flow of data between different network components. Your task is to properly label the vertices as A, B, C, and D, and assign corresponding weights of 1, 2, and 3 to the edges. Once you have organized this information, you will need to write it to a file in LEDA format, ensuring that the vertex labels and edge weights are accurately represented. This will help the technical team to analyze and optimize the network connectivity.
### Response:
from igraph import Graph

# Create a new graph with 4 vertices and 3 edges
g = Graph(n=4, edges=[(0, 1), (1, 2), (2, 3)])

# Add vertex and edge attributes
g.vs['name'] = ['A', 'B', 'C', 'D']
g.es['weight'] = [1, 2, 3]

# Write to a LEDA format file, storing vertex names and edge weights
g.write_leda('graph.leda', names='name', weights='weight')
<|EOT|>
