• No results found

Conclusions and Directions for Research

In this chapter, we have described the general notion of graph transformation and the rule- based graph programming language GP 2. We have covered GP 2’s syntax and semantics and described a simple GP 2 program. We have also given an overall view of evolutionary computation, covering the significant areas of GAs, ES, GP, and Neuroevolution. We have paid particular attention to graph-based EAs, giving detailed descriptions and comparative discussions of CGP, PDGP and NEAT. We have also described a number of other graph-based EAs.

This chapter is a discussion of the context in which this thesis operates. We have seen that graph-based EAs can be used to solve problems in a broad and varied set of domains:

1. Digital circuits [154, 157, 253, 254]. 2. Approximate digital circuits [165, 250]. 3. Cryptographic circuits [179, 180].

4. Symbolic expressions [155, 188, 189, 253]. 5. Forecasting [37, 58, 241, 264].

6. Various forms of automata [118, 177, 206, 232]. 7. Sequences of instructions [114, 137]. 8. Image processing [88, 89, 201]. 9. Video-game agents [120, 121, 210]. 10. ANNs [4, 117, 124, 126, 192, 195, 222, 238, 245]. 11. CPPNs [73, 74, 94, 220]. 12. DNN architectures [136, 153, 226]. 13. Bayesian networks [47, 166, 261].

This list is not exhaustive, and there are further domains which have been approached from the perspective of graph-based evolution.

We have also seen that, in many of these works, much of the contribution of the research is to propose new genetic operators over graphs. See, for example, the representation and modification of CGP solutions [157], the history-based genetic crossover used in NEAT [222], or the proposed crossover operator in [177]. We can, therefore, see a clear precedent in the

literature of interest in the general evolution of graphs and therefore the design of genetic operators over graphs. Further, we often see that correctness of evolution is achieved through constraints on the representation [138, 157, 189], or even correction of the phenotype [261].

It is here that we find the intersection between our literature on graph-based evolution and our description of rule-based graph programming. On one hand, we have a clear problem- driven desire to express correct functions over graphs to use as genetic operators. On the other hand, the graph programming language GP 2 provides a concise and formal paradigm to describe relations over graphs. This brings us back to the motivations and aims we set out in Chapter 1, with the literature we have covered justifying our ambitions to design EAs using graph programs as a paradigm for describing genetic operators.

Abstract

To implement probabilistic genetic operators as rule-based graph programs, we require access to a probabilistic variant of graph programming. In this chapter, we describe an extension of GP 2, termed Probabilistic GP 2 (P-GP 2), which supports both probabilistic rule choice and probabilistic matching. We outline the implementation of this extension as a modification of the existing GP 2 compiler. A number of probabilistic graph programs are given: probabilistic graph colouring, Karger’s algorithm for graph cutting and two models of random graphs. We stress that these examples are independent of our motivating application to Evolutionary Algorithms (EAs), highlighting the versatility of the work undertaken. Relevant Publications

Content from the following publications is used in this chapter:

[7] T. Atkinson, D. Plump, and S. Stepney, “Probabilistic graph programming,” in Pre-Proc. Graph Computation Models, GCM 2017, 2017.

[9] T. Atkinson, D. Plump, and S. Stepney, “Probabilistic graph programs for ran- domised and evolutionary algorithms,” in Proc. International Conference on Graph Transformation, ICGT 2018, ser. LNCS, vol. 10887. Springer, 2018, pp. 63–78.

3.1 Introduction

The semantics of GP 2 are non-deterministic in two respects: to execute a rule-set {r1, . . . , rn}

on a host graph G, any of the rules applicable to G can be picked and applied; and to apply a rule r, any of the valid matches of r’s left-hand side in the host graph can be chosen. GP 2’s compiler [17] has been designed by prioritising speed over completeness, thus it simply chooses the first applicable rule in textual order and the first match that is found.

For some algorithms, compiled GP 2 programs reach the performance of hand-crafted C programs. For example, [17] contains a 2-colouring program whose run-time on input graphs of bounded degree matches the run-time of Sedgewick’s program in Graph Algorithms in C. Clearly, this implementation of GP 2 is not meant to produce different results for the same input or make random choices with pre-defined probabilities.

However, probabilistic choice is a powerful algorithmic concept which is essential to both randomised and Evolutionary Algorithms (EAs). Randomised algorithms take a source of random numbers in addition to input and make random choices during execution. There are many problems for which a randomised algorithm is simpler or faster than a conventional deterministic algorithm [164]. EAs, on the other hand, can be seen as randomised heuristic search methods employing the generate-and-test principle. They drive the search process by variation and selection operators which involve random choices [64]. The existence and practicality of these probabilistic algorithms motivates the extension of graph programming languages to the probabilistic domain. Note that our motivation is different from existing simulation-driven extensions of graph transformation [97, 132]: we propose high-level pro- gramming with probabilistic constructs rather than specifying probabilistic models.

To cover algorithms on graphs that make random choices, we define Probabilistic GP 2 (P- GP 2) by extending GP 2 with two constructs: (1) choosing rules according to user-defined probabilities and (2) choosing rule matches uniformly at random.

We present four case studies in which we use P-GP 2 to implement randomised algorithms. The first algorithm is a probabilistic program which produces graph colourings. Empirical data shows that the effectiveness of this program at finding globally optimal solutions decays rapidly as input graphs grow in size. The second example is Karger’s randomised algorithm for finding a minimum cut in a graph [115]. The algorithm comes with a probabilistic analysis, which guarantees a high probability that the cut computed by the program is minimal. The third example is sampling from Gilbert’s G(n, p) random graph model [75]. The program generates random graphs with n vertices such that each possible edge occurs with probability

p. The final example is sampling from the D(n, E) random directed graph model. The program generates random directed graphs with n vertices and E edges.

This chapter is organised as follows. In Section 3.2 we describe the syntax and semantics of P-GP 2. We also discuss the probabilistic models induced when using P-GP 2, and the implementation of P-GP 2. In Section 3.3 we describe our four example probabilistic graph programs. We draw comparisons with other approaches to probabilistic behaviour in graph transformation in Section 3.4. Finally, we conclude our findings and set out directions for future work in Section 3.5.