From you description, I get the following inference task:
Input: Set of nodes
Output: A (complete) set of edges between the nodes.
So initially there is not graph structure and hence any algorithm that uses a graph structure will not be suited to the problem.
To find a suitable algorithm, let's break this down:
Basic Task
Your very basic question is: given two nodes $i$ and $j$, are they connected?
This is a binary classification problem:
- Describe the nodes with feature vectors $x_i$ and $x_j$ and (if available) their relation by $x_{ij}$. This gives you an input vector $(x_i, x_j, x_{i,j})$.
- Your target variable is $y_{ij} \in \{0,1\}$ where $y_{ij}=1$ means there is an edge.
- As training data you take all possible pairs of nodes in all your training graphs.
- For the inference step, you iterate over all possible pairs of nodes and get one predicition of each node.
- Any classifier could be used for this. Choose one that works well with your data.
Extensions
Of course one can think of some extensions. Without knowing your use case in detail, I will just list a few.
Contextual Information
The basic task takes only into account two nodes and the information between both. But maybe there is some contextual information about the application or graph. If you can describe this context as some feature vector $x_G$ then you can extend your input vector to $(x_i, x_j, x_{i,j}, x_G)$.
Learned Contextual Information
Maybe there is no clear contextual information, but you assume that there might be some. Then you can take a neural network that can handle sequences (e.g. LSTMs or transformers), feed the sequence of nodes into it and get a fixed-length-vector $x_G$ out of it.
This can either be done as some sort of embedding or you integrate this sequence network into the larger edge-classification architecture and train all together.
Graph Refinement
Maybe the edge classifier (see basic task)is not good enough. Then you might consider a two phase approach:
- Build the graph structure using the basic approach.
- Now that you got an initial graph, you can use this as input for your original approach and try to refine the network. This might add some edges and remove some others.
Undirected Graph
The approach above is designed for directed graphs. For undirected graphs you could
- Only classify edges $(i,j)$ for $i < j$. This applies for both training and inference.
- Use a modified direction-invariant input vector, e.g. $(x_i+x_j, x_{ij})$
- Derive the decision about an edge based on the predictions for both directions.
Edge Labels
If there is a (small) fixed set of labels, you can use a multi-class classification with classes no-edge, edge-label-1, ..., edge-label-n
Directed Acyclic Graphs
The pairwise approach does not necessarily avoid cycles. An ad-hoc approach to avoid cycles, would use the continuous / probabilistic prediction. This allow you to add one edge after another, based on there prediction, starting with the highest value. Any edge, that creates a cycle is skipped. This will prevent cycles to appear.
An alternative would be to created the graph first and later break cycles. There is some work about that, e.g. Sun, Jiankai, et al. "Breaking cycles in noisy hierarchies.".