<｜begin▁of▁sentence｜>### Instruction:
Given a networkx erdos_renyi_graph with params n=300, p=0.25, can you use BreadthFirstSearchSampler to sample a subgraph which has 50 nodes and compute the diameter of the sampled graph ?
### Response:
import networkx as nx
from littleballoffur import BreadthFirstSearchSampler

G = nx.gnp_random_graph(n=300, p=0.25)

sampler = BreadthFirstSearchSampler(50, seed=123)

sampler_G = sampler.sample(G)

result = nx.diameter(sampler_G)

print(result)
<|EOT|>
