- Research
- Open access
- Published:
SDW2vec: learning structural representations of nodes in weighted networks
Applied Network Science volume 10, Article number: 32 (2025)
Abstract
Recent advances in machine learning have prompted researchers to integrate complex network structures into computational frameworks to improve inferential capabilities. Node embedding has become a promising technique in this area. However, challenges persist in accurately representing the structural characteristics of nodes in weighted networks. In this study, we propose SDW2vec, which learns the embeddings of nodes in weighted networks while preserving structural properties. Our proposed methodology addresses these challenges through a multi-scale comparison of link weights among adjacent nodes up to a predefined hop count. This approach facilitates the calculation of distances between nodes’ structural configurations across multiple scales. We subsequently construct weighted multi-layer graphs based on these distance measurements, apply random walks to generate node sequences, and learn the embedding representations using the Skip-gram model. The efficacy of our methodology is validated through both the interpretability of embedding representations in controlled network environments and the structural reproducibility demonstrated in real-world networks.
Introduction
Complex networks have emerged as a fundamental framework for modeling interconnected systems across diverse domains. These networks comprise elements (nodes) and their interactions (links). In weighted networks, link weights capture the strength of interactions, enabling more refined representations of real-world complexity. By leveraging link weights, one can model intricate information such as relationship strength, distance, cost, or capacity between nodes (Barrat et al. 2004). Social network analyses, for instance, can express the intensity of interpersonal connections (Opsahl et al. 2010), while transportation network studies can represent geographical distances or travel times (Barthélemy 2011).
Recent advances in machine learning have prompted researchers to investigate the integration of complex network structures into computational frameworks, seeking enhanced inferential capabilities. Node embedding has emerged as a particularly promising approach, aimed at mapping similar nodes near each other within vector spaces. This technique preserves nodes’ intrinsic characteristics by representing them as continuous vectors while maintaining their network-based similarities (Goyal and Ferrara 2018; Zhou et al. 2022). Node embedding incorporates two primary similarity criteria: nodal proximity within the network (proximity-based embedding) and the structural similarity of connection patterns (structure-based embedding) (Ahmed et al. 2020). Proximity-based embeddings focus on preserving information about node connections, rendering them particularly effective for tasks such as community clustering. Conversely, structure-based embeddings delve deeper by capturing the local connectivity patterns of nodes, demonstrating particular strength in role discovery. A critical insight in network analysis is that nodes can exhibit structural similarity through comparable degrees, even when they exist in distinct network components (non-connected sub-networks within a larger network structure) (Rossi et al. 2020). This characteristic enables the assessment of nodal similarities across disparate network configurations, transcending the limitations of traditional proximity-based methodologies. The implications of this approach extend beyond mere structural analysis. Specifically, such embeddings facilitate domain adaptation strategies that enable the transfer of node label information between heterogeneous networks (Liu et al. 2022). By capturing underlying structural similarities, researchers can develop more sophisticated methods for knowledge transfer and comparative network analysis, opening new avenues for interdisciplinary network research.
Embedding weighted networks presents significant analytical challenges. Traditional unweighted methods typically rely on binary adjacency matrices, whereas weighted networks demand more sophisticated approaches that can accommodate real-valued representations of link intensities. Proximity-based embedding methods like DeepWalk (Perozzi et al. 2014) and walklets (Perozzi et al. 2017) can be extended to weighted networks, but capturing structural features becomes substantially more complex when both link quantity and strength must be simultaneously considered. Existing approaches often struggle to adequately capture the structural properties inherent in weighted networks.
To address these limitations, we propose SDW2vec for learning embedding representations that effectively preserve nodes’ structural features in weighted networks. We define structural properties for nodes in weighted networks and develop a series of distance functions to evaluate structural similarities across multiple scales. Our proposed method generates node embeddings by adapting the struc2vec framework, with the potential for application across networks with varying characteristics. Evaluations conducted on both toy networks and real-world datasets demonstrated the significant efficacy of the proposed methodology, validating its superior performance relative to existing approaches.
The subsequent sections of this paper are organized as follows: Sect. Preliminary and related research presents related research, Sect. Methodology details our methodology, Sect. Experiments and results discusses experimental results, and Sect. Conclusion provides a conclusion.
Preliminary and related research
Weighted networks
A weighted network is formally defined as a tuple \(G=(V,E)\), where \(V=\{v_1,v_2,\ldots,v_n\}\) represents the set of nodes, and \(E\) denotes the link set, defined as \(E=\{(v_i,v_j,w_{ij}) \mid v_i,v_j \in V,\, w_{ij} \in \mathbb {R}\}\). In this representation, \(w_{ij} \in \mathbb {R}\) corresponds to the weight assigned to the link between nodes \(v_i\) and \(v_j\).
The network taxonomy extends to more complex configurations. A network \(G\) is classified as a signed network when it contains at least two distinct links with weights \(w_{ij} > 0\) and \(w_{kl} < 0\), respectively. Similarly, the network is termed directed when the ordering of nodes in the link tuples \((v_i,v_j,w_{ij})\) in \(E\) indicates a directional relationship from node \(v_i\) to \(v_j\). The structural and weighted properties of \(G\) are comprehensively encapsulated in its weighted adjacency matrix \(W=(w_{ij})^{n\times n}\), where each entry \(w_{ij}\) specifies the weight of the link from node \(v_i\) to \(v_j\). This research focuses on weighted networks that may exhibit variations in signs and directionality.
Structure in weighted networks
Network structure diverges fundamentally from network proximity. While proximity concerns the specific nodes to which a node is connected, structure delves into the manner of those connections. In previous studies, structural equivalence in the network has been discussed from various perspectives (Rossi and Ahmed 2014). Traditional network analysis in unweighted networks has relied on the concept of automorphic equivalence, a sophisticated notion of structural similarity. Automorphic equivalence posits that nodes \(u\) and \(v\) are equivalent if an automorphic mapping \(p\) exists such that \(u = p(v)\). More broadly, an isomorphism between graphs \(G=(V_1,E_1)\) and \(H=(V_2,E_2)\) requires a bijective mapping that preserves relational structures. When the graphs are identical, this mapping becomes an automorphism.
Intuitively, structural equivalence explores whether nodes can be interchanged while maintaining their relational integrity. Previous research has employed relaxed interpretations of automorphic equivalence to assess node structure (Ribeiro et al. 2017; Xu et al. 2019). Existing studies have traditionally emphasized node degree as the primary structural feature, iteratively aggregating degree information across a predefined number of hops to assess local structure (Ribeiro et al. 2017).
In this research, we simultaneously consider both node degree and link attributes (weights, signs, and directions) to define node structure as the local connection patterns. Recognizing the rarity of nodes with precisely identical link numbers and weights, we introduce a more flexible definition of structural equivalence that captures the intricate characteristics of weighted networks.
Node embedding
Node embedding represents a critical computational approach that maps network nodes to vectors in a low-dimensional space while preserving essential network characteristics (Goyal and Ferrara 2018; Zhou et al. 2022). Functioning as a pivotal bridge between network-structured data and vector-based machine learning tasks, node embedding transforms network representations into computationally tractable forms. Given a network represented as a graph \(G=(V,E)\), the node embedding task involves learning a mapping function \(f:V \rightarrow \mathbb {R}^d\) that projects each node \(v_i \in V\) to a \(d\)-dimensional vector \(\textbf{z}_i \in \mathbb {R}^d\), where the dimensionality \(d\) is typically significantly smaller than the total number of nodes \(|V|\).
The generated embeddings serve as versatile representations for numerous downstream machine learning tasks, including link prediction, node classification, and role discovery (Cui et al. 2018; Kumar et al. 2020; Tang et al. 2016; Liu et al. 2021). A fundamental principle of node embedding is that similar nodes should occupy proximal positions within the vector space, with similarity criteria varying based on network context and specific application requirements. These similarity measures predominantly encompass two primary approaches: proximity-based similarity, which focuses on nodal closeness within the network, and structure-based similarity, which examines the intricate connection patterns of nodes (Rossi et al. 2020).
Existing research has predominantly concentrated on proximity-based embedding approaches. Seminal works such as DeepWalk (Perozzi et al. 2014) leverage random walks to capture node adjacency relationships, while Walklets (Perozzi et al. 2017) extends this concept by incorporating skip operations to generate embeddings that consider adjacency information across multiple hops. The APP methodology (Zhou et al. 2017) introduced random walks with restart operations to accommodate asymmetric adjacency matrices. Alternatively, some methods capture structural information as part of a broader objective rather than by directly learning embeddings for each node. For example, role2vec (Ahmed et al. 2019) is a framework that focuses on embedding roles–groups of structurally equivalent nodes–instead of the nodes themselves. Another such method is xNetMF (Heimann et al. 2018), a matrix factorization technique that leverages structural similarity not as an end in itself, but as a component to align nodes across different graphs.
Structure-based embedding representation learning represents a complementary approach. The struc2vec framework (Ribeiro et al. 2017) generates embeddings through random walks on multilayer graphs that capture nodal structural characteristics across multiple hop ranges. GraphWave (Donnat et al. 2018) provides an alternative perspective by treating spectral graph wavelet diffusion patterns as probability distributions, subsequently generating embedding representations from characteristic functions. To the best of our knowledge, there are no existing structure-based embedding methods specifically designed for weighted networks in the current literature.
Graph Neural Networks (GNNs) offer an alternative mechanism for generating node embeddings that entails diverse architectures. Unlike direct embedding methods, GNNs function as end-to-end models that typically require inference labels for specific learning tasks, with node embeddings emerging as a derivative outcome. A critical limitation of GNN approaches lies in their embedding generation process, which is substantially influenced by task-specific labels and learning objectives. Consequently, these methods present significant challenges for unsupervised learning downstream tasks where explicit label information is unavailable. Consequently, GNNs fall outside the scope of this study.
Methodology
Conceptual diagram of the proposed methodology. The figure illustrates the workflow from a raw weighted network to the final node embeddings and a downstream task. A A sample signed, directed, and weighted network. Node colors represent distinct structural roles. Link color indicates the sign (e.g., red for negative), and thickness corresponds to weight. B The network’s weighted adjacency matrix. C Extraction of weight lists for each node, separated into different channels (e.g., positive outgoing links). D Transformation of weight lists into rescaled weight distributions (rwd) using an entropy-optimized binning process. E Calculation of structural distances between node pairs at multiple hop depths (k = 0 to k = 3). F Construction of a multi-layer graph where each layer k connects nodes based on their k-hop structural similarity. Inter-layer links connect the same node across different layers. G Generation of node sequences (contexts) via random walks on the multi-layer graph. H Learning of low-dimensional node embeddings from the context sequences using the Skip-gram model. Structurally similar nodes (e.g., nodes 0 and 9) are mapped to nearby points in the embedding space. I Application of the learned embeddings to a downstream task, such as visualization of node structure
In this section, we introduce our proposed methodology, SDW2vec. The nomenclature reflects its application domain, where S, D, and W represent signed, directed, and weighted networks, respectively. This indicates that our method is capable of embedding nodes in signed, directed, weighted networks.
The overall workflow of the proposed methodology, as illustrated in Fig. 1, begins with deriving the weighted degree of each node (Fig. 1C) from the adjacency matrix (Fig. 1B) corresponding to the target weighted network (Fig. 1A). This is subsequently transformed into weight distributions (Fig. 1D). Subsequently, distances up to multiple hops are computed using a specific distance function (Fig. 1E). Following the struc2vec framework (Ribeiro et al. 2017), a multilayer graph where structurally similar nodes are connected with high weights is constructed (Fig. 1F), followed by context generation through random walks and embedding learning (Fig. 1G, H). We now elaborate on the weighted degree and its corresponding distance function.
Weighted degree: definition of node structure in weighted networks
In weighted signed directed networks, links are categorized into four distinct channels: +out, −out, +in, and −in. The structural properties of a node depend on the number of links, their weights, signs, and directions.
The 0-hop structural information of node \(i\), as illustrated in Fig. 1C, is aggregated into a weighted degree sequence (\(\textrm{wd}_i^c\), a set of real numbers), where \(c\) denotes the channel (\(c \in \{+\textrm{out}, -\textrm{out}, +\textrm{in}, -\textrm{in}\}\)). This sequence is defined as:
The weighted degree sequence represents the weights of links associated with a node, where the sequence length equals the number of links in a specific channel. Depending on network properties, link weights may be discrete or continuous. For example, in e-commerce rating networks, user-to-product links often have discrete weights (e.g., integer ratings from 1 to 5), whereas gene co-expression networks may use continuous weights (e.g., correlation coefficients between \(-\)1.0 and +1.0).
In weighted networks, a node’s structural characteristics are determined by both its total degree (number of links) and the distribution of link weights. We hypothesize that the weights of links associated with a node follow a latent probability distribution, which encapsulates the node’s structural features. We propose that discretizing the weights in a weighted network may enable the extraction of pseudo-structures, thereby facilitating the analysis of structural equivalence that incorporates the strength of connections. To implement this, we applied a binning operation to discretize the link weights, allowing the transformation of continuous weight values into discrete intervals. This approach provides a framework for evaluating node roles and network organization while explicitly accounting for variations in connection intensity. Specifically, the weighted degree sequence is treated as a sampled realization from this latent distribution. Through a binning function \(f\) (Eq. 2), the weighted degree sequence is discretized to approximate the latent weight distribution (\(\textrm{rwd}_i^c\)):
The function \(f\) typically partitions the weight domain into equal-intervals or equal-frequency bins. For instance, in Fig. 1C, the +out channel uses bins defined by boundaries [0.5, 1.5, 2.5, 3.5].
The selection of \(f\) and the number of bins could be carried out depending on the nature of the network or the purpose of the particular task. We provide a technique to search for the optimal \(f\) and the number of bins in the perspective of preserving entropy. This approach is grounded in the principle that higher entropy levels establish more robust boundaries for information preservation in embedding learning tasks. For all link weights in channel \(c\), we search for the optimal combination of \(f\) and the number of bins using the elbow method to preserve the entropy of \(\textrm{rwd}^c\) efficiently. Let \(W^c = \{w_1, w_2, \ldots, w_n\}\) be the set of link weights in channel \(c\), and the optimization problem can be formulated as:
where \(H(W^c)\) is the original entropy of the link weights and \(H\left(f(W^c, b)\right)\) is the entropy after applying partition function \(f\) with b bins. We select \((f, b)\) that minimizes the entropy difference while maintaining the most informative representation.
The overall latent weight distribution for node \(i\) across all channels is obtained by concatenating the distributions from each channel (Eq. 3), where \(||\) denotes vector concatenation:
Here, \(\textrm{rwd}_i\) is termed the weighted degree of node \(i\).
Distance function: assessment of distance between node structure
Next, we define the distance between weighted degrees. Since weighted degrees are essentially probability distributions, we apply Jensen–Shannon (JS) divergence to calculate the distance between distributions, due to the requirement of symmetry in the distance between weighted degrees. Since \(\textrm{rwd}\) represents the number of links falling into the corresponding bin, it is divided by the sum of \(\textrm{rwd}\) (namely, node degree) before calculating JS divergence:
Furthermore, it is natural to consider that links with larger weights have a greater impact on the node structure. Thus, we weight \(\textrm{rwd}\) by the importance of bins. Specifically, for \(\textrm{rwd}_i^c=\text {[}x_1,\cdots, x_L\text {]}\) divided into L bins, \(x_1\) represents the number of links in bin 1. When the importance of bins \(\text {[}1,\cdots, L\text {]}\) is \(\text {[}b_1,\cdots, b_L\text {]}\), the corrected \(\hat{\textrm{rwd}}_i^c\) becomes:
\(b_1x_1\) represents the corrected number of links in bin 1 with weight \(b_1\). In this method, we use default corrections of \(b_i=i\) and \(b_i=L-i+1\) for positive and negative channels, respectively.
Therefore, the adjusted version of Eq. 4 becomes:
In addition to the channel and weight distribution differences, node degree is another crucial structural feature. In this research, we evaluate the difference of degree by the relative difference of the maximum frequency in \(\max (\textrm{rwd})\):
By dividing by the sum of maximum frequencies, we can capture minor differences as fluctuations for nodes with large scales, thereby more accurately capturing the structure in scale-free networks. If two nodes have different degrees but share the same weight distributions, Eq. 7 is equivalent to \(\left| \frac{d_i-d_j}{d_i+d_j}\right| \).
Consequently, to incorporate both JS divergence and the relative maximum frequency difference, we define the 0-hop distance (\(d_0\)) between node i and j as follows:
Here, S is a constant adjusting the distance sensitivity. We proposed a technique to search for the optimal S and see Appendix C for details.
In Eq. (8), \(D_\textrm{JSD}(\cdot )\) measures the difference in link weight distributions between nodes, with a value range of \([0, \log 2]\). \(D_\textrm{scale}(\cdot )\) measures the frequency scale difference of maximum values, with a value range of \(\text {[}0, 1\text {]}\), which is proportionally compatible with \(D_\textrm{JSD}(\cdot )\)’s range.
Furthermore, the distance between k-hop neighboring nodes’ \(\textrm{rwd}\) sequences (denoted as \(\textrm{RWD}\)) of node i and j is defined as:
\(\textrm{DTW}\) is the Dynamic Time Warping function, an algorithm capable of measuring similarity between time series of varying lengths, calculating the differences between sequences by identifying the optimal alignment between them Salvador and Chan (2007). \(\textrm{DTW}(f,A,B)\) measures the distance between two sequences A and B using the function f.
struc2vec framework: generating embeddings in multiple scales
We apply the struc2vec framework (Ribeiro et al. 2017) to generate embeddings from the structural distance between nodes on multiple hops. The struc2vec framework involves constructing multilayer networks (Fig. 1F), generating contexts via random walks (Fig. 1G), and learning embeddings.
To construct multilayer network, we first calculate the structural similarity between all node pairs using the following equations.
Then, we construct a \(k^{\textrm{max}}\)-layer weighted graph with inter-layer link weights defined as:
Connections between the same nodes between layers follow:
where \(\Gamma {k(i)}\) counts how often node i’s link weights exceed the layer average.
Random walks on the multilayer graph generate context sequences containing structurally similar nodes. Intra-layer transition probabilities are:
with inter-layer transitions governed by:
Finally, Skip-Gram (Mikolov et al. 2013) learns node embeddings from context sequences, aligning with its distributional hypothesis that structurally similar nodes appear in analogous contexts.
Experiments and results
In this section, we present a systematic comparison between SDW2vec and existing methods. In Sect. Visualization of node structure in toy networks we employ four small-scale toy networks to visually demonstrate the structural embedding capabilities of our method. In Sect. Reconstruction of networks in real networks, we conduct validation using real-world networks spanning diverse domains. Through two network reconstruction tasks, we quantitatively illustrate that the embeddings learned by our method inherently preserve structural information.
Visualization of node structure in toy networks
Visualization results of node embedding representations. The figure displays the node embedding representations learned by SDW2vec and other comparison methods for various toy networks. A1–D1 Visualizations of the four toy networks: star, mesh, ring, and path networks. Node colors indicate structurally equivalent nodes, considering link signs, directions, and weights. Link colors represent link signs, and link thickness corresponds to link weights. A2–D2 Silhouette scores for different methods on the particular network. A higher Silhouette score indicates better clustering of structurally equivalent nodes. A3–D10 Node embeddings for four networks produced by SDW2vec, struc2vec, GraphWave, DeepWalk, walklets, app, role2vec, and xNetMF, respectively. In each scatter plot, ideally, points of the same color (representing structural equivalence) should be clustered together
Dataset
To intuitively demonstrate the proposed method’s ability to learn nodes’ structural embedding representations, we conducted an experiment to verify the interpretability of the embedding representations. As shown in Figs. 2A1–D1, we focused on weighted signed directed toy networks based on network topology.
Figure 2A1’s star network features a central node 0 with 16 other nodes connected to this central node in a star-like structure. Figure 2B1’s mesh is a complete network consisting of 8 nodes. Figure 2C1’s ring is a circular network where each node connects to two adjacent nodes. Figure 2D1’s path network has four paths connected to nodes 4 or 5.
Some links are negative or unidirectional. Link colors represent link signs, and link thickness corresponds to the link weights indicated by link labels. Node colors indicate structurally equivalent nodes, considering link signs, directions, and weights.
Comparison methods
As comparison methods, we used structure-based approaches struc2vec (Ribeiro et al. 2022), GraphWave (Donnat et al. 2018), role2vec (Ahmed et al. 2019) and xNetMF (Heimann et al. 2018), proximity-based methods DeepWalk (Perozzi et al. 2014) and walklets (Perozzi et al. 2017), and app (Zhou et al. 2017).
struc2vec cannot handle link signs, directions, and weights, so it uses an unsigned, undirected binary network as input. GraphWave does not support link signs and weights, so it uses a network retaining only directional information.
Experimental setup
SDW2vec hyperparameters were set as follows: 100 walks per node, walk length of 80, window size of 5, maximum layers of 5, and output dimension of 2. For the discretization function of \(\textrm{rwd}\) in Eq. 2, we used equally spaced bins with a maximum of 10 bins, configured for directed and signed networks.
To ensure a fair and reproducible comparison, hyperparameters for all methods were aligned where possible. The specific settings for the comparison methods are detailed in Appendix E.
Results
The learned node embedding representations from each method were visualized in two-dimensional scatter plots, as shown in Fig. 2. Since node colors represent structural equivalence, it is desirable for points of the same color to be clustered together.
In the star network (Fig. 2A3), SDW2vec clearly forms color-based clusters, positioning structurally equivalent nodes close to each other in the embedding space. In contrast, comparison methods (Figs. 2A4 to A10) show mixed-color clusters, poorly reflecting structural equivalence.
For the mesh network (Figs. 2B3 to B10), all methods struggled to capture the network structure. This is likely due to the dense clique structure, where small differences are obscured by overall homogeneity. GraphWave (Fig. 2B5) performed relatively better but, being limited to directional information, positioned nodes 1 and 3 in the same location as nodes 5 and 7.
In the ring network (Fig. 2C3) and path network (Fig. 2D3), SDW2vec forms color-separated clusters, whereas comparison methods show mixed colors, failing to reflect structural features.
Overall, the proposed SDW2vec method effectively achieved color-based cluster formation in most networks, appropriately reflecting nodes’ structural equivalence in the embedding representation. While some comparison methods demonstrated moderate performance on specific networks, they generally failed to capture network structures effectively. xNetMF performed well on the ring and path networks, but poorly on the star and mesh networks.
This performance difference stems from SDW2vec’s ability to extract nodes’ structural features from the perspectives of link signs, directions, and weights. In contrast, comparison methods insufficiently utilize sign and weight information, and differences in learning objectives likely contribute to their suboptimal results.
We also carried out an experiment to demonstrate the impact of maximum hop \(k_max\) on embedding quality. See Appendix A for details.
Reconstruction of networks in real networks
To verify whether the embeddings appropriately preserve link weight information, we conducted a network reconstruction experiment using real-world datasets. Specifically, we focused on predicting link weights and node strengths, evaluating the embeddings’ ability to reconstruct the original network structure. The embeddings were derived from the original network structure, with link and node target labels also derived from the same structure.
Datasets
The real-networks employed in this experiment span biological, social, and transportation systems. They are moreno_kangarooFootnote 1 (Grant 1973), moreno_lesmisFootnote 2 (Knuth 1993), moreno_trainFootnote 3 (Hayes 2006), moreno_beachFootnote 4 (Freeman et al. 1998), moreno_rhesusFootnote 5 (Sade 1972), moreno_sampsonFootnote 6 (Breiger et al. 1975), moreno_sheepFootnote 7 (Hass 1991), ucidata-gamaFootnote 8 (Read 1954), advogatoFootnote 9 (Massa et al. 2009), opsahl-usairportFootnote 10 (Opsahl 2011), socsign-bitcoinalphaFootnote 11 (Kumar et al. 2016); Kunegis 2013). Appendix D provides the statistics for the datasets and the execution time of the proposed method.
Comparison methods and settings
Comparison methods and their hyperparameters remained the same as in the previous experiment. For the proposed method, we set the maximum layer number to 3 and the embedding representation dimension to 16, a result of balancing network scale and computational cost.
Link weight prediction
We first obtained 16-dimensional node embeddings from each method, concatenating source and target node embeddings to create a 32-dimensional link embedding.
Using link embeddings as explanatory variables and link weights as labels, we randomly split links into 80% test data and 20% validation data, trained a Ridge regression model (Pedregosa et al. 2011) using test data, and predicted labels on validation data. Ridge regression was chosen to eliminate machine learning model influences and focus solely on embedding quality. Root Mean Square Error (RMSE) was used as the performance metric, with lower RMSE indicating higher accuracy. The experiment was repeated 100 times with different data splits, and the average results were reported.
Link weight prediction results
The results are presented in Table 1. SDW2vec outperformed other methods in 7 out of 11 datasets, demonstrating the highest performance. This indicates that SDW2vec embeddings effectively preserve link weight information. In contrast, DeepWalk, struc2vec, and xNetMF achieved the best performance in 2, 1, and 1 datasets, respectively. Note that xNetMF and role2vec failed to generate embeddings for two datasets.
The lower performance of the proposed method in some datasets can be attributed to potentially non-optimal weight discretization settings. For instance, in the opsahl-usairport network, discretizing into 10 bins likely resulted in significant information loss, given the 9,968 unique weight values. In the ucidata-gama network, with weights limited to −1 and +1, the network is essentially a signed network without weights, which falls outside the designed scope of the proposed method.
Node strength prediction
We conducted a network reconstruction experiment by predicting node strengths. Node strength is defined as the sum of weights of links connected to a node, namely, \(s_i^c = \sum _{j\in N(i)}w_{ij}^c\). We predicted strengths for each channel.
We used 16-dimensional node embeddings from each method as explanatory variables and the channel-wise strengths as labels, randomly split nodes into 80% test data and 20% validation data. After trained a multi-label Ridge regression model using test data, we predicted labels on validation data. Performance was measured by RMSE score, with lower RMSE indicating higher accuracy. The experiment was repeated 100 times with different data splits, and average results were reported.
Node strength prediction results
The results are presented in Table 2. SDW2vec outperformed other methods in 6 out of 11 datasets, demonstrating the highest performance. This suggests that SDW2vec embeddings effectively capture node strength information. Struc2vec and DeepWalk achieved the best RMSE in two networks each. xNetMF achieved the best RMSE in one network, but failed to generate proper embedding in two networks. The inferior performance in some networks is similarly attributed to weight discretization challenges, consistent with the link weight prediction results.
Case study: detecting important subgraphs via structural embeddings
As an example of a downstream task, we conducted an experiment to detect important subgraphs using structural embeddings. The results demonstrate both the feasibility and superiority of the proposed method. Detailed information is provided in Appendix B.
Conclusion
In this research, we proposed a learning method for embedding representations that capture structural information in weighted networks. We introduced weighted degrees and weight probability distributions that account for structural attributes such as link signs, directions, and weights, and defined distance functions to measure their similarities. Through experimental validation, we demonstrated the method’s superior interpretability and structural reconstruction capabilities.
Future research directions include (1) investigating practical applications of structural information across various real-world domains, extending the method’s utility beyond network analysis, (2) developing strategies to reduce the computational complexity of the proposed method, potentially through algorithmic optimization or approximation techniques, (3) exploring adaptive embedding learning approaches that can dynamically adjust representation strategies based on specific downstream tasks and network characteristics.
Availability of data and materials
The implementation codes and data are available in Github (https://github.com/liushu2019/SDW2vec).
Notes
References
Ahmed NK, Rossi RA, Lee JB, Willke TL, Zhou R, Kong X, Eldardiry H (2019) role2vec: role-based network embeddings. In Proceeding DLG KDD, pp 1–7
Ahmed N, Rossi RA, Lee J, Willke T, Zhou R, Kong X, Eldardiry H (2020) Role-based graph embeddings. IEEE Trans Knowl Data Eng 34:2401
Barrat A, Barthelemy M, Pastor-Satorras R, Vespignani A (2004) The architecture of complex weighted networks. Proc Natl Acad Sci 101(11):3747–3752
Barthélemy M (2011) Spatial networks. Phys Rep 499(1–3):1–101
Breiger RL, Boorman SA, Arabie P (1975) An algorithm for clustering relational data with applications to social network analysis and comparison with multidimensional scaling. J Math Psychol 12(3):328–383
Cui P, Wang X, Pei J, Zhu W (2018) A survey on network embedding. IEEE Trans Knowl Data Eng 31(5):833–852
Donnat C, Zitnik M, Hallac D, Leskovec J (2018) Learning structural node embeddings via diffusion wavelets. In: Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data mining, pp 1320–1329
Freeman LC, Webster CM, Kirke DM (1998) Exploring social structure using dynamic three-dimensional color images. Soc Netw 20(2):109–118
Goyal P, Ferrara E (2018) Graph embedding techniques, applications, and performance: a survey. Knowl-Based Syst 151:78–94
Grant TR (1973) Dominance and association among members of a captive and a free-ranging group of grey kangaroos (Macropus giganteus). Anim Behav 21(3):449–456
Hass CC (1991) Social status in female bighorn sheep (Ovis canadensis): expression, development and reproductive correlates. J Zool 225(3):509–523
Hayes B (2006) Connecting the dots: can the tools of graph theory and social-network studies unravel the next big plot? Am Sci 94(5):400–404
Heimann M, Shen H, Safavi T, Koutra D (2018) Regal: Representation learning-based graph alignment. In: Proceedings of the 27th ACM international conference on information and knowledge management, pp 117–126
Knuth DE (1993) The Stanford GraphBase: a platform for combinatorial computing, vol 37. Addison-Wesley, Reading
Kumar A, Singh SS, Singh K, Biswas B (2020) Link prediction techniques, applications, and performance: a survey. XXPhys A 553:124289
Kumar S, Spezzano F, Subrahmanian VS, Faloutsos C (2016) Edge weight prediction in weighted signed networks. In: Proceedings international conference on data mining, pp 221–230
Kunegis J (2013) KONECT–the Koblenz network collection. In: Proceedings international conference on world wide web, pp 1343–1350. http://dl.acm.org/citation.cfm?id=2488173
Liu S, Toriumi F, Nishiguchi M, Usui S (2022) A flexible framework for multiple-role discovery in real networks. Appl Netw Sci 7(1):1–23
Liu S, Toriumi F, Nishiguchi M, Usui S (2021) Multiple role discovery in complex networks. In: International conference on complex networks and their applications. Springer, pp 415–427
Massa P, Salvetti M, Tomasoni D (2009) Bowling alone and trust decline in social network sites. In: Proceedings of the international conference on dependable, autonomic and secure computing, pp 658–663
Mikolov T, Chen K, Corrado G, Dean J (2013) Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781
Opsahl T, Agneessens F, Skvoretz J (2010) Node centrality in weighted networks: generalizing degree and shortest paths. Soc Netw 32(3):245–251
Opsahl T. Why anchorage is not (that) important: binary ties and sample selection. http://wp.me/poFcY-Vw
Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E (2011) Scikit-learn: machine learning in Python. J Mach Learn Res 12:2825–2830
Perozzi B, Al-Rfou R, Skiena S (2014) Deepwalk: online learning of social representations. In: Proceedings of the 20th ACM SIGKDD international conference on knowledge discovery and data mining, pp 701–710
Perozzi B, Kulkarni V, Chen H, Skiena S (2017) Don’t walk, skip! Online learning of multi-scale network embeddings. In: Proceedings of the 2017 IEEE/ACM international conference on advances in social networks analysis and mining 2017. ASONAM ’17. Association for computing machinery, New York, NY, USA, pp 258–265. https://doi.org/10.1145/3110025.3110086
Read KE (1954) Cultures of the central highlands, New Guinea. Southwest J Anthropol 10(1):1–43
Ribeiro LFR, Savarese PHP, Figueiredo DR struc2vec: learning node representations from structural identity, pp 385–394. https://doi.org/10.1145/3097983.3098061, arxiv:1704.03165
Ribeiro LF, Saverese PH, Figueiredo DR (2017) struc2vec: learning node representations from structural identity. In: Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining, pp 385–394
Rossi RA, Ahmed NK (2014) Role discovery in networks. IEEE Trans Knowl Data Eng 27(4):1112–1131
Rossi RA, Jin D, Kim S, Ahmed NK, Koutra D, Lee JB (2020) On proximity and structural role-based embeddings in networks: misconceptions, techniques, and applications. ACM Trans Knowl Discov Data (TKDD) 14(5):1–37
Sade DS (1972) Sociometrics of Macaca mulatta I. linkages and cliques in grooming matrices. Folia Primatol 18(3–4):196–223
Salvador S, Chan P (2007) Toward accurate dynamic time warping in linear time and space. Intell Data Anal 11(5):561–580
Tang J, Aggarwal C, Liu H (2016) Node classification in signed social networks. In: Proceedings of the 2016 SIAM international conference on data mining. SIAM, pp 54–62
Xu K, Hu W, Leskovec J, Jegelka S (2019) How powerful are graph neural networks? In: International conference on learning representations. https://openreview.net/forum?id=ryGs6iA5Km
Zhou J, Liu L, Wei W, Fan J (2022) Network representation learning: from preprocessing, feature extraction to node embedding. ACM Comput Surv (CSUR) 55(2):1–35
Zhou C, Liu Y, Liu X, Liu Z, Gao J (2017) Scalable graph embedding for asymmetric proximity. In: Proceedings of the 31st AAAI conference on artificial intelligence. AAAI’17. AAAI Press, pp 2942–2948
Zhou C, Liu Y, Liu X, Liu Z, Gao J (2017) Scalable graph embedding for asymmetric proximity. In: Proceedings of the AAAI conference on artificial intelligence, vol 31
Funding
This work was supported by JST SPRING Grant Number JPMJSP2108, and JSPS KAKENHI Grant Number JP24KJ0764. This work was financially supported in part by TechnoPro Holdings, Inc.
Author information
Authors and Affiliations
Contributions
S.L. organized research, built the framework, conducted experiments, and wrote this manuscript; S.L. and F.T. obtained funding; M.C. and F.T. discussed the results and provided critical reviews. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Ethics approval and consent to participate
Not applicable.
Consent for publication
Not applicable.
Competing interests
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Below is the link to the electronic supplementary material.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Liu, S., Chujyo, M. & Toriumi, F. SDW2vec: learning structural representations of nodes in weighted networks. Appl Netw Sci 10, 32 (2025). https://doi.org/10.1007/s41109-025-00722-x
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s41109-025-00722-x