<｜begin▁of▁sentence｜>### Instruction:
Given a graph with 5 vertices arranged in a tree with a branching factor of 2, can you use the DFSIter iterator in igraph to perform a Depth-First Search and output the order of the vertices traversed in JSON format?
### Response:
from igraph import Graph
import json

# Create an example graph
g = Graph.Tree(5, 2) # A tree with 5 vertices and branching factor 2

# Perform a Depth-First Search (DFS) on the graph
vertex_order = g.dfsiter(mode='OUT')

# Convert the vertex order to a list and store in JSON
output = [v.index for v in vertex_order]
json_output = json.dumps({'vertex_order': output})

print(json_output)
<|EOT|>
