You're dealing with a black-box optimization problem over the space of directed graphs with n nodes (7 ≤ n ≤ 25), where:
- The search space is discrete and combinatorially large (in fact, doubly exponential in
n if you allow arbitrary directed edges).
- The objective function (i.e., the score of a graph) is non-differentiable, likely non-convex, and expensive to compute.
- You're given no explicit gradient information, just the ability to evaluate the score function at specific graph instances.
- Your goal is to maximize the score (fitness) efficiently with as few graph evaluations as possible.
This setting falls squarely within the context of combinatorial optimization with an expensive objective, and the space of directed graphs makes it especially complex due to its discrete, structured nature.
Let’s discuss plausible frameworks for tackling this problem.
1. Genetic Algorithms (GAs)
A genetic algorithm is indeed a reasonable first approach, particularly because:
- The solution space (directed graphs) is discrete and structured, and GAs are naturally suited for that.
- GAs are derivative-free optimization techniques, meaning they don’t require gradient information.
- Variants such as NeuroEvolution of Augmenting Topologies (NEAT) and Cartesian Genetic Programming have been applied successfully to evolve graph-like structures.
Key considerations when using GAs here:
- Representation: You can represent a graph using an adjacency matrix or edge-list encoding. Size of the chromosome becomes
n^2 booleans (or integer weights if edges are weighted).
- Crossover / Mutation Operators: Need to be specifically designed to avoid generating invalid or pathological structures (e.g., graphs with trivial components, or that violate problem-specific constraints).
- Fitness Evaluation: Since the score function is expensive, you may benefit from fitness caching or surrogate modeling (see below).
However, GAs can be sample inefficient, especially under limited budget of evaluations. For this reason, GAs are best used when paired with techniques that reduce evaluation cost.
2. Bayesian Optimization (BO) in Combinatorial Spaces
Given that each evaluation is costly, and the search space is structured but discrete, Bayesian Optimization using a suitable surrogate model is a strong candidate.
Classically, BO has been applied over continuous spaces, but in recent years, extensions to combinatorial and graph spaces have emerged.
Graph Kernel + Gaussian Process Surrogate
- Represent graphs with meaningful features (e.g., graph kernels, graph embeddings, or graph spectra) and use a surrogate model (like a Gaussian Process, or Random Forests) to approximate the score function.
- BO sequentially selects the next graph to evaluate by optimizing an acquisition function (e.g., UCB, EI, or Thompson sampling).
This approach is computationally intelligent in that it accounts for uncertainty in unexplored regions. It can yield high performance with relatively few score evaluations, which is vital here.
Possible Implementations:
- Recent frameworks like COMBO (Combinatorial Bayesian Optimization) are designed for such graph-based optimization tasks.
- Implementations relying on graph neural networks (GNNs) to encode graphs into latent spaces for BO are also possible (see BANANAS, GNN-GP, etc.).
3. Reinforcement Learning (RL) — Probably Not Ideal Here
While meta-RL or policy-gradient-based graph construction agents (graph builder agents) have been explored in some literature, RL is typically sample-inefficient, requiring many environments or episode rollouts to converge.
Drawbacks in your case:
- Expensive score evaluation makes classic RL less tractable — reward signal is too costly.
- No clear environment dynamics exist — constructing graphs from scratch in a Markovian way is unnatural unless you model it creatively (e.g., via autoregressive graph-generation policies).
- Requires complicated tuning and training time.
However, if you had a cheaper proxy evaluation function or could train in simulation, RL variants (like REINFORCE or PPO) using GNN policy networks could potentially be useful, but this is quite costly compared to BO or GA.
4. Hybrid Approaches
Often the best results in practical combinatorial black-box optimization come from blended methods:
- Evolutionary Search with Surrogate Modeling: For instance, start with a population-based GA, but maintain a cheap surrogate model (e.g., via random forests or neural nets) trained on observed scores. Use the surrogate to rank or pre-select candidate graphs before scoring them accurately.
- Active Learning over Graphs: By treating each graph as a datapoint and using methods like active kernel learning, you can efficiently explore promising graph candidates.
5. Local Search Heuristics
Simple but effective techniques include:
- Simulated Annealing over the space of graphs, where neighbor graphs are built by edge deletion/insertion.
- Greedy Construction: Start from empty graph or fully connected one, and iteratively add/remove edges with highest marginal gains.
Local search is inexpensive and can be embedded within robust meta-frameworks.
Summary of Recommendations:
| Method | Pros | Cons | Suitability |
|---|
| Genetic Algorithms | Easy to apply, good for discrete structures | Slow convergence; sample inefficient | Good baseline; combine with caching or surrogate model |
| Bayesian Optimization | Sample efficient; minimizes evaluations | Needs good graph representation | Best if evaluations are expensive |
| Reinforcement Learning | Expressive, adaptable | Sample inefficient, complex training | Not ideal unless context rich |
| Hybrid (GA + Surrogates) | Balances exploration and efficiency | Added implementation complexity | Very practical |
| Local Search / Hill Climbing | Fast exploration | Stuck in local optima | Useful when paired with restarts |
Concrete Suggestion for You:
Given the graph evaluation is expensive and n is relatively small (up to 25):
Use Combinatorial Bayesian Optimization, with well-designed graph encodings (e.g., graph kernel or learned GNN embeddings), and a Gaussian process or random forest surrogate. Implement acquisition functions to efficiently query the most promising next graphs to evaluate. Combine with an initial random or GA-based population.**
If implementation simplicity is key, start with:
- A genetic algorithm with elitism, edge mutation, and tournament selection.
- Add fitness memoization, and later, train a lightweight regression model (e.g., gradient-boosted trees) to estimate scores and rank candidates.
You can then explore selective application of Bayesian optimization or neural-guided search as added refinements.
Let me know the specific nature of your graph scoring function or if there are domain-specific constraints (e.g., need for acyclicity, sparsity, etc.). That can significantly influence the algorithm design.