<｜begin▁of▁sentence｜>### Instruction:
Given the need to generate an Erdős–Rényi random graph G(n, c/n), where c is the mean expected degree and c = 1, how can you create this graph using the NetworkX's random_kernel_graph function, which utilizes a kernel with integral and root functions to define probabilities of edge formations between nodes?
### Response:
import networkx as nx
from scipy.optimize import brentq

def integral(u, w, z):
    c = 1  # mean expected degree
    return c * (z - w)

def root(u, w, r):
    return r + w

# Create a random graph based on the specified kernel
G = nx.random_kernel_graph(1000, integral, root)
<|EOT|>
