<｜begin▁of▁sentence｜>### Instruction:
Imagine you're a biologist studying the migration paths of a specific bird species. Each year, these birds travel through various points that offer different resources, such as food, shelter, and mates. You've set up research stations at points "A", "B", "C", and "D" to collect data on the resources available at each location, and you've observed the birds making stops at each of these points.

You've gathered the following data on the resource expenditure (weighted cost) involved in traveling from one station to another: the journey from station "A" to "B" costs 3 units, from "A" to "C" costs 17 units, from "A" to "D" costs 14 units, from "B" to "A" costs 3 units, from "B" to "C" costs 12 units, from "B" to "D" costs 16 units, from "C" to "A" costs 13 units, from "C" to "B" costs 12 units, from "C" to "D" costs 4 units, from "D" to "A" costs 14 units, from "D" to "B" costs 15 units, and from "D" to "C" costs 2 units.

To better understand the efficiency of the birds' migration path, you've decided to use computational tools to model their habitat as a complete weighted undirected graph with the research stations as nodes and the observed resource expenditures as edge weights. The model will allow you to simulate and analyze possible migration routes starting and ending at station "D" with the goal of determining a resource-effective cycle.

Using software that employs NetworkX's greedy approach, your objective is to estimate a migration path (cycle) for the birds that starts and ends at station "D", while minimizing the total resource expenditure. How might you apply the NetworkX library to process this ecological data and deduce a low-cost cycle, as well as calculate the total resource expenditure for this cycle?
### Response:
from networkx.algorithms import approximation as approx
import networkx as nx

# Create a complete weighted undirected graph
G = nx.Graph()
G.add_weighted_edges_from([
    ("A", "B", 3), ("A", "C", 17), ("A", "D", 14),
    ("B", "A", 3), ("B", "C", 12), ("B", "D", 16),
    ("C", "A", 13), ("C", "B", 12), ("C", "D", 4),
    ("D", "A", 14), ("D", "B", 15), ("D", "C", 2)
])

# Compute a low cost cycle starting from node 'D'
cycle = approx.greedy_tsp(G, source="D")

# Calculate the total cost of the cycle
cost = sum(G[n][nbr]["weight"] for n, nbr in nx.utils.pairwise(cycle))

# Output the results
print("Cycle:", cycle)
print("Total cost:", cost)
<|EOT|>
