This is the post-print version of the following article: Takahiro Yokoyama, Yoshiki Sato, Sho Tsugawa, and Kohei Watabe, ``An Accurate Graph Generative Model with Tunable Features,'' in Proceedings of the 32nd International Conference on
Computer Communications and Networks (ICCCN 2023) Poster Session, 2023. The original publication is available at https://doi.org/10.1109/ICCCN58024.2023.102301 (DOI: 10.1109/ICCCN58024.2023.102301). (c) 2023 IEEE. Personal useof this material is permitted. Permission from IEEE must be obtained for all other users, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works for resale or redistribution to servers orlists, or reuse of any copyrighted components of this work in other works.

An Accurate Graph Generative Modelwith Tunable Features
1st Takahiro Yokoyama

2nd Yoshiki Sato

Graduate School of Engineering
Nagaoka University of Technology
Nagaoka, Niigata, Japans203193@stn.nagaokaut.ac.jp

Graduate School of Engineering
Nagaoka University of Technology
Nagaoka, Niigata, Japans171039@stn.nagaokaut.ac.jp

3rd Sho Tsugawa

4th Kohei Watabe

Faculity of Engineering, Information and Systems
University of TsukubaTsukuba, Ibaraki, Japans-tugawa@cs.tsukuba.ac.jp

Graduate School of Engineering
Nagaoka University of Technology
Nagaoka, Niigata, Japank watabe@vos.nagaokaut.ac.jp

Abstract—A graph is a very common and powerful data
structure used for modeling communication and social networks.
Models that generate graphs with arbitrary features are important basic technologies in repeated simulations of networks
and prediction of topology changes. Although existing generativemodels for graphs are useful for providing graphs similar toreal-world graphs, graph generation models with tunable features
have been less explored in the ﬁeld. Previously, we have proposed
GraphTune, a generative model for graphs that continuously tune
speciﬁc graph features of generated graphs while maintaining
most of the features of a given graph dataset. However, thetuning accuracy of graph features in GraphTune has not been
sufﬁcient for practical applications. In this paper, we propose amethod to improve the accuracy of GraphTune by adding a newmechanism to feed back errors of graph features of generated
graphs and by training them alternately and independently.
Experiments on a real-world graph dataset showed that thefeatures in the generated graphs are accurately tuned comparedwith conventional models.
Index Terms—Graph generation, Conditional VAE, LSTM,Graph feature, Generative model.

I. I NTRODUCTION
In ﬁelds regarding communication networks, graph generative models have a wide variety of applications such as
network synthesis for simulations, emulation of information
spreading on networks, link prediction on social networks,etc. Generative models for graphs can be categorized into
two types: stochastic and learning-based models. Stochasticmodels focus on reproducing only a single-aspect feature ofgraphs (e.g., scale-free feature). On the other hand, learningbased models aim to learn features directly from a graphdataset and reproduce graphs that have similar features tothe graph dataset, thus reproducing features in every single
aspect. We have proposed a generative model for graphs,
GraphTune [1], that allows continuous tuning of speciﬁcfeatures while maintaining the reproducibility of the other
This work was partly supported by JSPS KAKENHI JP20H04172.

graph features. Although GraphTune has succeeded in making
features of a generated graph change depending on userspeciﬁed values, there still remains an issue on the tuning
accuracy of features.
In this paper, we propose to extend GraphTune by adding
a feature estimator that feeds back information on features ofgraphs reconstructed by GraphTune. These two models, theLong Short-Term Memory (LSTM)-based feature estimatorand GraphTune, are trained independently of each other by analternate training algorithm to avoid target leakage in feature.
GraphTune with the feature estimator enables tuning speciﬁcfeatures more accurately than GraphTune while keeping thereproducibility of GraphTune in every single feature.
II. G RAPH T UNE
GraphTune treats graph data as a graph sequence converted
by a DFS code and learns to reconstruct an input sequence inthe Conditional Variational AutoEncoder (CVAE) framework.
DFS code converts graphs into sequences of unique edges
through depth-ﬁrst search. In CVAE, the sequence is processedby an encoder, and then the decoder generates a sequence.
Lastly, the generated sequence is converted to a generatedgraph. A condition vector is input to the encoder and the decoder to tune a speciﬁc feature. The elements of the condition
vector mean the speciﬁed value of features focused on (e.g.
values of average shortest path length, cluster coefﬁcient, thepower-law exponent of the degree distribution, etc.).
Encoder: Encoder learns to map from sequence data andcondition vector to a multivariate normal distribution according to graph features. A latent vector is sampled from thatmapped distribution.
Decoder: Decoder learns to reconstruct an input sequencesfrom the latent and the condition vectors. The ﬁrst input
is generated with the vectors, and a subsequent sequence isrecursively generated by LSTM. When we generate a graphusing GraphTune, we input a sampled latent vector and aGraphTune

Encoder・・・

Decoder

・・・・・・...

・・・

Reconstructedsequence

Estimated featurevector
Graphdataset

・・・・・・・・・・・・

...

・・・

Condition vector
Sequence

LSTM-based
feature estimator

IV. E XPERIMENTS

Fig. 1. Proposed model composed of GraphTune and a feature estimator.
GraphTune
Length_3.0
Length_4.0
Length_5.0
Real_data1.0
Density0.8
0.60.40.2
0.00.0

Proposed

1.2

Length_3.0
Length_4.0
Length_5.0
Real_data

1.0
0.8
Density

1.2

0.6
0.4
0.2

2.5

5.0 7.5 10.0 12.5 15.0
Average path length

0.00.0

2.5

that is input to GraphTune part may leak to the feature
estimator side, and appropriate training cannot be expected.
Therefore, an alternate training algorithm is applied to train
the GraphTune part and the feature estimator alternately. In
the algorithm, when training one model, the parameters of theother model are freezed. By repeating this alternate training,the dependency between the two models is eliminated andappropriate training is achieved.

5.0 7.5 10.0 12.5 15.0
Average path length

Fig. 2. Kernel density estimation plots for the generated graphs when average
shortest path length is speciﬁed as 3.0, 4.0, or 5.0.

speciﬁed condition vector to the decoder and obtain a sequence
representing a feature-tuned graph.
III. P ROPOSED M ODELWe propose an accurate generative model for graphs thatextends GraphTune by adding an LSTM-based model called afeature estimator (see Fig. 1). The feature estimator estimatesvalue of features of a generated graph and adds an error
between the estimated values and elements of a condition
vector (i.e. speciﬁed values of features) to the overall loss.
In other words, the feature estimator feeds back information
on features in generated graphs to neural networks in theGraphTune part, thereby allowing more accurate tuning offeatures. To appropriately train the proposed model, we also
propose a training algorithm to avoid target leakage.
GraphTune part: GraphTune part in our model learns toreconstruct a sequence from input sequence and a condition
vector in the same manner as the original GraphTune. The
details of the process follow the paper of GraphTune [1]. In
the generation step, only GraphTune part is used.
Feature estimator: The feature estimator learns to estimate
values of features of an output graph from a sequence reconstructed by GraphTune part. The reconstructed sequences
are recursively input to the LSTM block. The output of thelast LSTM block is an estimator of values of features wefocused on. The error between the estimator and the valuesof the features of the input graph is added to the loss of theGraphTune part to provide direct feedback on the accuracyof feature reproduction. Note that the feature estimator takes
only reconstructed sequences as input and does not use thecondition vector.
In the training of the proposed model, information of acondition vector (i.e. the value of the feature of input graphs)

We train the models and generate graphs using a real graphdataset to verify the effectiveness of the proposed model in theaccuracy of graph generation. We use 2,000 induced subgraphs
sampled from the Twitter who-follows-whom graph in theHiggs Twitter Dataset [2] for training in order to compare theproposed model with GraphTune. The average shortest path
length was used as the condition vector, and three patterns
were speciﬁed at generation: 3.0, 4.0, and 5.0, each of which
was set to generate 300 graphs.
The parameters of the proposed model are set as follows.
The size of the single fully connected layer placed before thefeature estimator is 256, the size of the hidden state vectorof the LSTM is 512, and the size of the last single fully
connected layer is 1. The parameters of the GraphTune part in
the proposed model and GraphTune as a comparison method
were set according to the paper of GraphTune [1]. The batch
size was set to 37, and the number of epochs in feature
estimator training was set to 10,000. The number of iterationsin the alternate training was set to 2.
To evaluate the tuning accuracy of graph features, thedistribution of the average shortest path length of the generated
graphs is shown Fig. 2. Depending on the speciﬁed value of theaverage shortest path length, the two models show a change indistribution. Especially when 5.0 is speciﬁed, indicating thatthe graphs generated by the proposed model are distributed
closer to the speciﬁed value than GraphTune.
V. C ONCLUSION
We extended GraphTune, a conventional generative modelwith tunable features, by adding a feature estimator modelthat estimates values of features on generated graphs. We
also proposed an alternate training algorithm to ensure thatGraphTune and the feature estimator cooperate with eachother and learn appropriately. Through experiments with areal-world graph dataset, we conﬁrmed that the proposedmodel can specify features more accurately than the original
GraphTune. We plan to apply various real-world graph datasets
and specify different graph features to verify the generalization
performance of the proposed model.
R EFERENCES[1] K. Watabe, S. Nakazawa, Y. Sato, S. Tsugawa and K. Nakagawa,“GraphTune: A Learning-Based Graph Generative Model with Tunable
Structural Features,” to appear in IEEE Transactions on Network Science and Engineering, doi: 10.1109/TNSE.2023.3244590.
[2] M.D. Domenico, A. Lima, P. Mougel, and M. Musolesi, “The Anatomyof a Scientiﬁc Rumor,” Scientiﬁc Reports, vol.3, no.2980, 2013.