<｜begin▁of▁sentence｜>### Instruction:
As a Traffic Engineer responsible for designing and managing transportation systems to enhance traffic flow and safety, imagine you're tasked with optimizing the flow of data through a complex network of sensors and control points along a three-tiered highway system. You need to leverage the capabilities of the Gephi Graph Streaming API to visualize and analyze the network structure.

Your specific challenge involves generating a JSON object representing this network, akin to a graphical map, utilizing the GephiGraphStreamer from the iGraph library. This JSON object will serve as the blueprint for streaming data to Gephi, enabling real-time monitoring and analysis of traffic patterns across the network.
### Response:
import igraph as ig
import json
from igraph import GephiGraphStreamer

# Create a simple graph
g = ig.Graph.Tree(3, 2)  # Tree graph with 3 levels and child degree 2

# Initialize the streamer with a file-like object
destination = open('graph_stream.json', 'w')
streamer = GephiGraphStreamer(destination)

# Post the entire graph to the file
streamer.post(g)

# Close the file
destination.close()
<|EOT|>
