Table of Contents
Fetching ...

Automating Reformulation of Essence Specifications via Graph Rewriting

Ian Miguel, András Z. Salamon, Christopher Stone

TL;DR

A system that employs graph rewriting to reformulate an input model for improved performance automatically and shows how to automatically translate the solution of the reformulated problem into a solution of the original problem for verification and presentation is presented.

Abstract

Formulating an effective constraint model of a parameterised problem class is crucial to the efficiency with which instances of the class can subsequently be solved. It is difficult to know beforehand which of a set of candidate models will perform best in practice. This paper presents a system that employs graph rewriting to reformulate an input model for improved performance automatically. By situating our work in the Essence abstract constraint specification language, we can use the structure in its high level variable types to trigger rewrites directly. We implement our system via rewrite rules expressed in the Graph Programs 2 language, applied to the abstract syntax tree of an input specification. We show how to automatically translate the solution of the reformulated problem into a solution of the original problem for verification and presentation. We demonstrate the efficacy of our system with a detailed case study.

Automating Reformulation of Essence Specifications via Graph Rewriting

TL;DR

A system that employs graph rewriting to reformulate an input model for improved performance automatically and shows how to automatically translate the solution of the reformulated problem into a solution of the original problem for verification and presentation is presented.

Abstract

Formulating an effective constraint model of a parameterised problem class is crucial to the efficiency with which instances of the class can subsequently be solved. It is difficult to know beforehand which of a set of candidate models will perform best in practice. This paper presents a system that employs graph rewriting to reformulate an input model for improved performance automatically. By situating our work in the Essence abstract constraint specification language, we can use the structure in its high level variable types to trigger rewrites directly. We implement our system via rewrite rules expressed in the Graph Programs 2 language, applied to the abstract syntax tree of an input specification. We show how to automatically translate the solution of the reformulated problem into a solution of the original problem for verification and presentation. We demonstrate the efficacy of our system with a detailed case study.

Paper Structure

This paper contains 7 sections, 5 figures.

Figures (5)

  • Figure 1: Graph showing format conversions and APIs. The white arrows within the blue area are parts of our system of conversion and the green arrows show interactions with GP2.
  • Figure 2: Parts of the specification that are interacted with during rewrite. Matched subtrees are highlighted in light blue. Names that can be used as free parameters are coloured in dark blue. Tagged nodes are highlighted in red.
  • Figure 3: 5-fold colouring of the dodecahedral graph.
  • Figure 4: Performance of the two specifications: we plot instances (with selected names listed along the horizontal axis), the reformulated specifications are green, the old specifications are blue, gold indicates both specifications time out, red indicates that the old specification times out.
  • Figure 5: Specification of the solution's converter and production flow. In this simpler example a function indexed by integers is turned into a sequence and back again.