<｜begin▁of▁sentence｜>### Instruction:
Given a graph generated with the Erdős-Rényi random graph model with 10 nodes and 20 edges, how can you write its adjacency matrix to a text file, separating the matrix elements with a comma and each row with a newline character?
### Response:
from igraph import Graph
import igraph as ig

g = ig.Graph.Erdos_Renyi(n=10, m=20)
g.write_adjacency('adjacency_matrix.txt', sep=', ', eol='\n')
print('Adjacency matrix written to file.')
<|EOT|>
