This paper addresses the issue of estimating structural models with data from a single graph, which is a longstanding problem in economics and related fields. While there exist methods for estimating structural models on independent and identically distributed graphs, there is limited research on a general-purpose algorithm to fit a structural model on a single network. This study proposes an algorithm adapted from deep learning for network analysis, which enables Bayesian and likelihood estimation of arbitrary structural models, provided that the graph data is within the range of the networks simulated by the structural model. Simulated data tests demonstrate the effectiveness and accuracy of this approach. Additionally, the algorithm is applied to estimate a homophily citation model (Bramoull´e et al., 2012), making it the first method, as far as the author is aware, capable of structurally estimating this model. Overall, this study presents a promising algorithm for fitting structural models on a single network, opening up avenues for future research in the field.