<｜begin▁of▁sentence｜>### Instruction:
As a foreign correspondent reporting from a remote region, I've been tasked with analyzing and documenting the network of local trade routes. By utilizing the NetworkX library, I aim to calculate the out-degree of each trading post in the region, which will be crucial for evaluating the commercial influence of different locations. Once this analysis is complete, I'll present the results in JSON format, providing a clear and structured overview of the out-degrees for each trading post.
### Response:
import json
from igraph import Graph

# Sample graph creation
g = Graph(edges=[(0, 1), (0, 2), (2, 3)], directed=True)

# Calculate the out-degrees of each vertex
out_degrees = g.outdegree()

# Convert the result to JSON
degrees_json = json.dumps({'out_degrees': out_degrees})

# Print the JSON string
print(degrees_json)
<|EOT|>
