<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with the edge set [('A', 'B', 3), ('A', 'C', 1), ('B', 'C', 4), ('B', 'D', 2), ('C', 'D', 5)], can you create an iterator to generate all spanning arborescences of the graph in order of increasing cost?
### Response:
import networkx as nx
from networkx.algorithms.tree.branchings import ArborescenceIterator

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

# Create an iterator for spanning arborescences of G in increasing cost
arborescence_iter = ArborescenceIterator(G, weight='weight', minimum=True)

# Iterate and print each arborescence
for arb in arborescence_iter:
    print(arb.nodes(), arb.edges())
<|EOT|>
