Layered block state with edge weights and/or different set of nodes across layers

Dear GT Community,

I've been working on community detection for some time already (Louvain/Leiden algorithms), but I got started with graph-tool only recently. After spending some time reading the HOWTO, I still haven't found answers to two questions that are related to the applicability of SBM to my data.

I'm analysing political coalitions by combining data from a survey, newspapers, and Twitter. To study coalitions across the three undirected and weighted networks (or more if I include temporal slices), I am using LayeredBlockState via NestedBlockState and sampling from the posterior distribution.

Question 1:
I haven't found an answer to whether it is possible to run SBM for layered networks with edge weights? I can get around this problem by extracting the noise-corrected 'backbone' of each network, which yields simple graphs, but ideally I wouldn't have to do too much violence to the data but be able to use the raw weighted networks as inputs. Is it possible to run LayeredBlockState with edge weights?

Question 2:
Even if the LayeredBlockState would not (yet) support weighted networks, I also have another, more fundamental question. As my three layers come from different data generation processes, they do not share the exact same set of nodes. For example, one organisation responded the survey but does not necessarily appear in the newspaper data. Is it possible to determine constraints for certain nodes in certain layers that would tell the LayeredBlockState to not consider layer-specific isolates?

This is how I currently set up the LayeredBlockState, but I'm not sure if I can count on the results due to the potential issue outlined in Q2.

g = binary multigraph with three layers stored in ep.layer
state = gt.inference.nested_blockmodel.NestedBlockState(g, base_type=LayeredBlockState, state_args=dict(ec=g.ep.layer, layers=True))

All help is much appreciated,
Arttu Malkamäki

attachment.html (7.91 KB)