<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with weighted edges [('A', 'B', 1), ('A', 'C', 2), ('B', 'C', 3), ('C', 'D', 4), ('D', 'A', 5)], how can we iterate over all spanning arborescences of the graph in increasing cost using NetworkX?
### Response:
import networkx as nx

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

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

# Use the iterator to find and print all spanning arborescences
for arborescence in arborescence_iter:
    print(arborescence.edges(data=True))
<|EOT|>
