<｜begin▁of▁sentence｜>### Instruction:
As an agronomist, imagine you're tasked with optimizing irrigation networks for a farm with 10 fields. Each field has a varying probability of needing irrigation, with an average probability of 0.5. To ensure efficient water distribution, you want to calculate the diameter of the irrigation network, representing the maximum distance between any two fields. You plan to use the `diameter` method from the irrigation network optimization toolkit (IrrigOptiKit) API to determine this crucial metric.
### Response:
from igraph import Graph

g = Graph.Erdos_Renyi(n=10, p=0.5)
diam = g.diameter()
print('Diameter of the graph:', diam)
<|EOT|>
