<｜begin▁of▁sentence｜>### Instruction:
Given a weighted directed graph whose edge set with weights is [('A', 'B', 3), ('A', 'C', 2), ('B', 'C', 4), ('C', 'A', 1)], can you compute a minimum branching (minimum spanning arborescence) using NetworkX?
### Response:
import networkx as nx
from networkx.algorithms.tree.branchings import minimum_branching

# Create a directed graph
G = nx.DiGraph()
G.add_weighted_edges_from([
    ('A', 'B', 3), ('A', 'C', 2),
    ('B', 'C', 4), ('C', 'A', 1)
], weight='weight')

# Compute a minimum spanning arborescence (directed version of a spanning tree)
min_branch = minimum_branching(G, attr='weight', default=1, preserve_attrs=True)

# Print edges of the minimum branching
print(min_branch.edges(data=True))
<|EOT|>
