SlideShare a Scribd company logo
DocEng2010, September 21– 24, 2010, Manchester, United Kingdom

A New Model for
Automated Table Layout
Mihai Bilauca

Patrick Healy

Department of Computer Science and Information Systems
University of Limerick, Ireland

Supported by Science Foundation Ireland under the research programme 01/P1.2/C009,
Mathematical Foundations, Practical Notations, and Tools for Reliable Flexible Software.
A New Model for Automated Table Layout
Overview
• An exact combinatorial optimization modelling method
for tables that do not contain spanning cells and
provide examples using OPL:
– Mixed Integer Programming model - MIP
– Constraint Programming Model - CP

• Report experimental results for tables with a size of up
to 40x40 (1,600 cells and 9,000 text configurations);
• Conclusions
A New Model for Automated Table Layout

Slide 2 of 35
A New Model for Automated Table Layout
Why a new method?
• For applications where finding the layout with the minimum height for a
given width is important.

• Because it is exact (not based on heuristics)

• Priority should be given to user constraints imposed by space limitations or
other aesthetic criteria;

• To the best of our knowledge this is the first attempt to report on run time for
large table sizes and specific (rather than heuristic) cell configurations
A New Model for Automated Table Layout

Slide 3 of 35
The Table Layout Problem
Find a layout λ of a table ℑ with minimum
such that

height (λ )

width(λ ) < W
W – a given page width

A New Model for Automated Table Layout

Slide 4 of 35
Definitions (Anderson and Sobti)
ℑ , m x n table, m rows, n columns, λ

is a layout of ℑ

k
k
Ci , j : {( wij , hij ) | 1 ≤ k ≤ K ij

is the set of configurations for cell i,j with

1 ≤ ki , j ≤ K ij

the index of the configuration selected from Ci,j
m

height (λ ) = ∑ hi
i =1

n

width(λ ) = ∑ w j
j =1

where hi = max(hi,j) for each row i, wj = max(wi,j) for each column j
ki , j
ij

hij = h
A New Model for Automated Table Layout

kij
wij = wij
Slide 5 of 35
Cell configurations
Example:
k
k
Ci , j : {( hij , wij ) | 1 ≤ k ≤ K ij
Cell configurations for cell i,j
this blue sky

A New Model for Automated Table Layout

this blue
grey

this
blue
sky

Slide 6 of 35
Integer Programming definition
m

n

minimize∑ max hi , j ,k ⋅ xi , j ,k
i =1

j =1

subject to
n

1)

m

∑ max w
i =1

j =1

2)
where
A New Model for Automated Table Layout

∑x

i , j ,k

i , j ,k

⋅ xi , j ,k ≤ W

= 1,

x ∈ {0,1}
1 ≤ ki , j ≤ K i , j
Slide 7 of 35
Table Layout problem is NP-complete
Demonstrated by:
• 1996 Wang - demonstration using large
integers;
• 1999 Anderson and Sobti - using
reductions of the clique problem to the
table layout, on simple tables.

A New Model for Automated Table Layout

Slide 8 of 35
OPL
OPL – Optimization Programming Language
designed for solving combinatorial optimization
problems.
• support for:
– MIP and constraint programming including search specification;
– logical and higher order constraints;
– support for scheduling and resource allocation applications;

• shares structure and syntax features with mathematical
programming languages such as AMPL or GAMS
• problems can be formulated in a language similar to their
algebraic notation

A New Model for Automated Table Layout

Slide 9 of 35
OPL Keywords
dvar – decision variable. The purpose of an OPL

model is to find values for the decision variables
such that all constraints are satisfied
dexpr - to express decision variables in a more

compact way
{dataType} - set of type dataType
<x,y> - represents a tuple value;
A New Model for Automated Table Layout

Slide 10 of 35
Data types
tuple Conf {int w; int h;}
tuple CellConf {int i; int j; Conf c;}
int pageW;
// page width
{CellConf} configs; // set of cell configurations
sample data: configs = {<0,0, <127,10>>, <0,0, <92,20>>,
<0,1, <75,20>>,<0,2, <65,10>>,…,}

{Cell} cells = {<i,j> | <i,j,k> in configs}
{int} rows = {i | <i,j> in cells}
{int} cols = {j | <i,j> in cells}
A New Model for Automated Table Layout

Slide 11 of 35
Basic MIP model - BMIP
dvar int cellSel[configs] in 0..1
minimize tableH
constraints
{
ct1:
tableW <= pageW

}

ct2: // select only one cell configuration
forall(i in rows,j in cols)
sum(<i,j,k> in configs) cellSel[<i,j,k>]== 1

A New Model for Automated Table Layout

Slide 12 of 35
BMIP – Table width/height
// cell width
dexpr int cellW[<i,j> in cells] =
sum(<i,j,k> in configs) cellSel[<i,j,k>] * k.w
// column width
dexpr int colW[j in cols] =
max(i in rows) cellW[<i,j>]
// table width
dexpr int tableW = sum(j in cols) colW[j]
• Table height is computed in a similar manner
A New Model for Automated Table Layout

Slide 13 of 35
MIP model
MIP model is based on two observations
a) The minimum column width minW[j] is the
maximum of minimum cell widths for a column j;
a) for each column, its width is one of the values
selected from the union of its cell configuration
widths colWset<j,k.w>;

A New Model for Automated Table Layout

Slide 14 of 35
MIP model
// compute minW[j]

int minW[j in columns] = max(i in rows)
min(<i,j,k> in configs) k.w
int minH[i in rows] = … //and similarly minH[i]
// for each column j, the set of possible widths

{ColW} colWset = {<j, k.w> | <i,j,k> in configs:
k.w >= minW[j] &&
k.h >= minH[i]}

A New Model for Automated Table Layout

Slide 15 of 35
MIP model
Two decision variables:
// column width selector
dvar int colSel[colWset] in 0..1
// cell configuration selector
dvar int cellSel[configs] in 0..1
// objective function
minimize tableH

A New Model for Automated Table Layout

Slide 16 of 35
MIP model
constraints{
ct1:… // table width < page width
ct2: // only one configuration per column
forall(j in columns)
sum(<j,k> in colWset) colSel[<j,k>] == 1;
ct3: // cell width <= column width
forall(j in columns, i in rows)
cellW[<i,j>] <= colW[j];
ct4:…} //select only one cell configuration
A New Model for Automated Table Layout

Slide 17 of 35
Constraint Programming model - CP
Advantage is given by support for two main activities of
combinatorial optimization algorithms:
– constraint reasoning for domain reduction
– search strategy specification for improved performance

Binary decision variables collSel and cellSel in
the MIP model become integer decision variables
colW[j] and rowH[i]

A New Model for Automated Table Layout

Slide 18 of 35
Constraint Programming model - CP
Strategy: find colW[j] and rowH[i] from the set of
possible widths and heights colWset and
rowHset such that
• the height of the table layout is minimized;
• table width is less than page width;
• for each cell i,j there is at least one configuration k
with a width less than or equal to colW[j] and
the height less than or equal to rowH[i]

wi , j ,k ≤ colW [ j ]
A New Model for Automated Table Layout

hi , j ,k ≤ rowH [ j ]
Slide 19 of 35
CP model - definitions
tuple Dim{int index; int value;}
Reduce the set of possible widths an heights:
{Dim} colWset = {<j, k.w> | <i,j,k> in
configs : k.w >= minW[j] && k.h >= minH[i]}
{Dim} rowHset = {<i, k.h> | <i,j,k> in
configs : k.w >= minW[j] && k.h >= minH[i]}

A New Model for Automated Table Layout

Slide 20 of 35
CP model - definitions
// two decision variables
dvar int colW[j in columns] in min(<j,w> in
colWset) w .. max(<j,w> in colWset) w;
dvar int rowH[i in rows] in min(<i,h> in
rowHset) h .. max(<i,h> in rowHset) h;
// define table width/height
dexpr int tableW = sum(j in columns) colW[j];
dexpr int tableH = sum(i in rows) rowH[i];
//objective function
minimize tableH;
A New Model for Automated Table Layout

Slide 21 of 35
CP model - constraints
constraints{
ct1:… // table width < page width
ct2:
forall(j in columns)
sum(<j,w> in colWset) (colW[j]==w) == 1
ct3:
forall(i in rows)
sum(<i,h> in rowHset) (rowH[i]==h) == 1
ct4:
forall(i in rows, j in columns)
sum(<i,j,k> in fConfigs)
(k.w <= colW[j] && k.h <= rowH[i]) >= 1}
A New Model for Automated Table Layout

Slide 22 of 35
CP model – search strategy
In OPL 5.5 there is no search language. The default
search can be tuned, by specifying search phases.
Maximal regret heuristic: the regret of a column is the
difference between its first and second choice of
possible width value

A New Model for Automated Table Layout

Slide 23 of 35
CP model – setting search strategy
var f = cp.factory
var phase0 = f.searchPhase(colW,
f.selectLargest(f.regretOnMax()),
f.selectLargest(f.value()));
var phase1 = f.searchPhase(rowH,
f.selectLargest(f.regretOnMin()),
f.selectSmallest(f.value()));
cp.setSearchPhases(phase0, phase1);

A New Model for Automated Table Layout

Slide 24 of 35
Adding user imposed constraints
Adding the user constraint that all columns must be of
equal width is easy:
constraints{
…
ct6:
forall(ordered j1, j2 in columns )
colW[j1] == colW[j2] ;
…}
the forall expression is equivalent to:
forall(j1,j2 in 1..n : j1 < j2).
A New Model for Automated Table Layout

Slide 25 of 35
Experimental results
What are the factors that impact on computational
time?
We tested the proposed models on two types of tables:
• tables with a small number of cells but a large
number of cell configurations
• large tables with cells that contain text with up to 6
words (size up to 40x40).

A New Model for Automated Table Layout

Slide 26 of 35
Experimental results
Tables with large amounts of text

Running time for a 3x3 table
and up to 200 words per
cell.

A New Model for Automated Table Layout

MIP model running time for
a 3x3 table; word-count per
cell varies from 200 to 600.

Slide 27 of 35
A New Model for Automated Table Layout

Slide 28 of 35
Experimental results
Tables with increasing size and configurations

Running time for a 10x10
table and up to 6 words per
cell.

A New Model for Automated Table Layout

MIP model running time for
10x10 tables; word count
per cell varies from 6 to 100.

Slide 29 of 35
Experimental results
Tables with fixed number of cell configurations
Table size
2x3x200
4x3x100
10x10x12
20x20x3

A New Model for Automated Table Layout

wSet
1,160
1,113
844
356

Slide 30 of 35
Conclusions
1. OPL provides viable solutions. The MIP model
which uses the CPLEX optimization engine
generally provides faster results than CP
2. The CP model can find a feasible solution faster
than the MIP model, but it continues to explore the
solution space until it finds whether the solution
found is the final objective;
3. Performance depends highly on the input data.
When the page width is closer to the minimum
table width the problem is harder to solve

A New Model for Automated Table Layout

Slide 31 of 35
Conclusions
1. It is more difficult to solve the table layout problem
when there is a large number of rows, columns and
column configurations than when the table has a
large number of cell configurations;
1. Hardware is essential:The CP engine reported that
1.76 Gb of memory was used to solve a table with
10.000 cells;

A New Model for Automated Table Layout

Slide 32 of 35
Conclusions
1. The constraint programming model may be slower
than the MIP model due to the version of the CP
engine used in testing. ILOG stopped supporting
the CP engine in 2005 but reintroduced it in 2007.
Not all search features are available
1. Using a modelling language allows user imposed
constraints to be easily added to the model
1. Paragraphing – is an essential step as it impacts on
the quality and computational time
A New Model for Automated Table Layout

Slide 33 of 35
Future work
To develop a model for tables with
• spanning cells
• inner tables
• other user constraints, i.e. constraints on group of
rows/columns
Note: We already developed a model for tables with
spanning cells ☺

A New Model for Automated Table Layout

Slide 34 of 35
Acknowledgements

We would like to express our gratitude to
Prof. David Parnas
for motivating much of this work

A New Model for Automated Table Layout

Slide 35 of 35
Acknowledgements

Questions ?

www.tabularlayout.org

A New Model for Automated Table Layout

More Related Content

PDF
Information Matrices and Optimality Values for various Block Designs
PDF
Particle Swarm Optimization Algorithm Based Window Function Design
PDF
Detection of Seam Carving in Uncompressed Images using eXtreme Gradient Boosting
PDF
Gradient boosting in practice: a deep dive into xgboost
PPTX
Quatum fridge
PPTX
Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...
PDF
Programs in array using SWIFT
Information Matrices and Optimality Values for various Block Designs
Particle Swarm Optimization Algorithm Based Window Function Design
Detection of Seam Carving in Uncompressed Images using eXtreme Gradient Boosting
Gradient boosting in practice: a deep dive into xgboost
Quatum fridge
Data Science Academy Student Demo day--Peggy sobolewski,analyzing transporati...
Programs in array using SWIFT

What's hot (17)

PDF
Design of multi objective cellular manufacturing
PDF
Image Retrieval Using VLAD with Multiple Features
PDF
Profiling in Python
DOCX
Introduction to r
PDF
Data visualization
PPT
Matlab Overviiew 2
PDF
Hyperparameter optimization with approximate gradient
PDF
Neuro -fuzzy-networks-for-identification-of-mathematical-model-parameters-of-...
PDF
Interpolation of-geofield-parameters
PDF
The Geometric Characteristics of the Linear Features in Close Range Photogram...
PDF
R class 5 -data visualization
PDF
Ijcga1
PDF
Test
PDF
Computer Graphics Concepts
PDF
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
PPTX
Python PCEP Creating Simple Functions
Design of multi objective cellular manufacturing
Image Retrieval Using VLAD with Multiple Features
Profiling in Python
Introduction to r
Data visualization
Matlab Overviiew 2
Hyperparameter optimization with approximate gradient
Neuro -fuzzy-networks-for-identification-of-mathematical-model-parameters-of-...
Interpolation of-geofield-parameters
The Geometric Characteristics of the Linear Features in Close Range Photogram...
R class 5 -data visualization
Ijcga1
Test
Computer Graphics Concepts
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
Python PCEP Creating Simple Functions
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPT
Teaching material agriculture food technology
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Ad

DocEng2010 Bilauca Healy - A New Model for Automated Table Layout

  • 1. DocEng2010, September 21– 24, 2010, Manchester, United Kingdom A New Model for Automated Table Layout Mihai Bilauca Patrick Healy Department of Computer Science and Information Systems University of Limerick, Ireland Supported by Science Foundation Ireland under the research programme 01/P1.2/C009, Mathematical Foundations, Practical Notations, and Tools for Reliable Flexible Software.
  • 2. A New Model for Automated Table Layout Overview • An exact combinatorial optimization modelling method for tables that do not contain spanning cells and provide examples using OPL: – Mixed Integer Programming model - MIP – Constraint Programming Model - CP • Report experimental results for tables with a size of up to 40x40 (1,600 cells and 9,000 text configurations); • Conclusions A New Model for Automated Table Layout Slide 2 of 35
  • 3. A New Model for Automated Table Layout Why a new method? • For applications where finding the layout with the minimum height for a given width is important. • Because it is exact (not based on heuristics) • Priority should be given to user constraints imposed by space limitations or other aesthetic criteria; • To the best of our knowledge this is the first attempt to report on run time for large table sizes and specific (rather than heuristic) cell configurations A New Model for Automated Table Layout Slide 3 of 35
  • 4. The Table Layout Problem Find a layout λ of a table ℑ with minimum such that height (λ ) width(λ ) < W W – a given page width A New Model for Automated Table Layout Slide 4 of 35
  • 5. Definitions (Anderson and Sobti) ℑ , m x n table, m rows, n columns, λ is a layout of ℑ k k Ci , j : {( wij , hij ) | 1 ≤ k ≤ K ij is the set of configurations for cell i,j with 1 ≤ ki , j ≤ K ij the index of the configuration selected from Ci,j m height (λ ) = ∑ hi i =1 n width(λ ) = ∑ w j j =1 where hi = max(hi,j) for each row i, wj = max(wi,j) for each column j ki , j ij hij = h A New Model for Automated Table Layout kij wij = wij Slide 5 of 35
  • 6. Cell configurations Example: k k Ci , j : {( hij , wij ) | 1 ≤ k ≤ K ij Cell configurations for cell i,j this blue sky A New Model for Automated Table Layout this blue grey this blue sky Slide 6 of 35
  • 7. Integer Programming definition m n minimize∑ max hi , j ,k ⋅ xi , j ,k i =1 j =1 subject to n 1) m ∑ max w i =1 j =1 2) where A New Model for Automated Table Layout ∑x i , j ,k i , j ,k ⋅ xi , j ,k ≤ W = 1, x ∈ {0,1} 1 ≤ ki , j ≤ K i , j Slide 7 of 35
  • 8. Table Layout problem is NP-complete Demonstrated by: • 1996 Wang - demonstration using large integers; • 1999 Anderson and Sobti - using reductions of the clique problem to the table layout, on simple tables. A New Model for Automated Table Layout Slide 8 of 35
  • 9. OPL OPL – Optimization Programming Language designed for solving combinatorial optimization problems. • support for: – MIP and constraint programming including search specification; – logical and higher order constraints; – support for scheduling and resource allocation applications; • shares structure and syntax features with mathematical programming languages such as AMPL or GAMS • problems can be formulated in a language similar to their algebraic notation A New Model for Automated Table Layout Slide 9 of 35
  • 10. OPL Keywords dvar – decision variable. The purpose of an OPL model is to find values for the decision variables such that all constraints are satisfied dexpr - to express decision variables in a more compact way {dataType} - set of type dataType <x,y> - represents a tuple value; A New Model for Automated Table Layout Slide 10 of 35
  • 11. Data types tuple Conf {int w; int h;} tuple CellConf {int i; int j; Conf c;} int pageW; // page width {CellConf} configs; // set of cell configurations sample data: configs = {<0,0, <127,10>>, <0,0, <92,20>>, <0,1, <75,20>>,<0,2, <65,10>>,…,} {Cell} cells = {<i,j> | <i,j,k> in configs} {int} rows = {i | <i,j> in cells} {int} cols = {j | <i,j> in cells} A New Model for Automated Table Layout Slide 11 of 35
  • 12. Basic MIP model - BMIP dvar int cellSel[configs] in 0..1 minimize tableH constraints { ct1: tableW <= pageW } ct2: // select only one cell configuration forall(i in rows,j in cols) sum(<i,j,k> in configs) cellSel[<i,j,k>]== 1 A New Model for Automated Table Layout Slide 12 of 35
  • 13. BMIP – Table width/height // cell width dexpr int cellW[<i,j> in cells] = sum(<i,j,k> in configs) cellSel[<i,j,k>] * k.w // column width dexpr int colW[j in cols] = max(i in rows) cellW[<i,j>] // table width dexpr int tableW = sum(j in cols) colW[j] • Table height is computed in a similar manner A New Model for Automated Table Layout Slide 13 of 35
  • 14. MIP model MIP model is based on two observations a) The minimum column width minW[j] is the maximum of minimum cell widths for a column j; a) for each column, its width is one of the values selected from the union of its cell configuration widths colWset<j,k.w>; A New Model for Automated Table Layout Slide 14 of 35
  • 15. MIP model // compute minW[j] int minW[j in columns] = max(i in rows) min(<i,j,k> in configs) k.w int minH[i in rows] = … //and similarly minH[i] // for each column j, the set of possible widths {ColW} colWset = {<j, k.w> | <i,j,k> in configs: k.w >= minW[j] && k.h >= minH[i]} A New Model for Automated Table Layout Slide 15 of 35
  • 16. MIP model Two decision variables: // column width selector dvar int colSel[colWset] in 0..1 // cell configuration selector dvar int cellSel[configs] in 0..1 // objective function minimize tableH A New Model for Automated Table Layout Slide 16 of 35
  • 17. MIP model constraints{ ct1:… // table width < page width ct2: // only one configuration per column forall(j in columns) sum(<j,k> in colWset) colSel[<j,k>] == 1; ct3: // cell width <= column width forall(j in columns, i in rows) cellW[<i,j>] <= colW[j]; ct4:…} //select only one cell configuration A New Model for Automated Table Layout Slide 17 of 35
  • 18. Constraint Programming model - CP Advantage is given by support for two main activities of combinatorial optimization algorithms: – constraint reasoning for domain reduction – search strategy specification for improved performance Binary decision variables collSel and cellSel in the MIP model become integer decision variables colW[j] and rowH[i] A New Model for Automated Table Layout Slide 18 of 35
  • 19. Constraint Programming model - CP Strategy: find colW[j] and rowH[i] from the set of possible widths and heights colWset and rowHset such that • the height of the table layout is minimized; • table width is less than page width; • for each cell i,j there is at least one configuration k with a width less than or equal to colW[j] and the height less than or equal to rowH[i] wi , j ,k ≤ colW [ j ] A New Model for Automated Table Layout hi , j ,k ≤ rowH [ j ] Slide 19 of 35
  • 20. CP model - definitions tuple Dim{int index; int value;} Reduce the set of possible widths an heights: {Dim} colWset = {<j, k.w> | <i,j,k> in configs : k.w >= minW[j] && k.h >= minH[i]} {Dim} rowHset = {<i, k.h> | <i,j,k> in configs : k.w >= minW[j] && k.h >= minH[i]} A New Model for Automated Table Layout Slide 20 of 35
  • 21. CP model - definitions // two decision variables dvar int colW[j in columns] in min(<j,w> in colWset) w .. max(<j,w> in colWset) w; dvar int rowH[i in rows] in min(<i,h> in rowHset) h .. max(<i,h> in rowHset) h; // define table width/height dexpr int tableW = sum(j in columns) colW[j]; dexpr int tableH = sum(i in rows) rowH[i]; //objective function minimize tableH; A New Model for Automated Table Layout Slide 21 of 35
  • 22. CP model - constraints constraints{ ct1:… // table width < page width ct2: forall(j in columns) sum(<j,w> in colWset) (colW[j]==w) == 1 ct3: forall(i in rows) sum(<i,h> in rowHset) (rowH[i]==h) == 1 ct4: forall(i in rows, j in columns) sum(<i,j,k> in fConfigs) (k.w <= colW[j] && k.h <= rowH[i]) >= 1} A New Model for Automated Table Layout Slide 22 of 35
  • 23. CP model – search strategy In OPL 5.5 there is no search language. The default search can be tuned, by specifying search phases. Maximal regret heuristic: the regret of a column is the difference between its first and second choice of possible width value A New Model for Automated Table Layout Slide 23 of 35
  • 24. CP model – setting search strategy var f = cp.factory var phase0 = f.searchPhase(colW, f.selectLargest(f.regretOnMax()), f.selectLargest(f.value())); var phase1 = f.searchPhase(rowH, f.selectLargest(f.regretOnMin()), f.selectSmallest(f.value())); cp.setSearchPhases(phase0, phase1); A New Model for Automated Table Layout Slide 24 of 35
  • 25. Adding user imposed constraints Adding the user constraint that all columns must be of equal width is easy: constraints{ … ct6: forall(ordered j1, j2 in columns ) colW[j1] == colW[j2] ; …} the forall expression is equivalent to: forall(j1,j2 in 1..n : j1 < j2). A New Model for Automated Table Layout Slide 25 of 35
  • 26. Experimental results What are the factors that impact on computational time? We tested the proposed models on two types of tables: • tables with a small number of cells but a large number of cell configurations • large tables with cells that contain text with up to 6 words (size up to 40x40). A New Model for Automated Table Layout Slide 26 of 35
  • 27. Experimental results Tables with large amounts of text Running time for a 3x3 table and up to 200 words per cell. A New Model for Automated Table Layout MIP model running time for a 3x3 table; word-count per cell varies from 200 to 600. Slide 27 of 35
  • 28. A New Model for Automated Table Layout Slide 28 of 35
  • 29. Experimental results Tables with increasing size and configurations Running time for a 10x10 table and up to 6 words per cell. A New Model for Automated Table Layout MIP model running time for 10x10 tables; word count per cell varies from 6 to 100. Slide 29 of 35
  • 30. Experimental results Tables with fixed number of cell configurations Table size 2x3x200 4x3x100 10x10x12 20x20x3 A New Model for Automated Table Layout wSet 1,160 1,113 844 356 Slide 30 of 35
  • 31. Conclusions 1. OPL provides viable solutions. The MIP model which uses the CPLEX optimization engine generally provides faster results than CP 2. The CP model can find a feasible solution faster than the MIP model, but it continues to explore the solution space until it finds whether the solution found is the final objective; 3. Performance depends highly on the input data. When the page width is closer to the minimum table width the problem is harder to solve A New Model for Automated Table Layout Slide 31 of 35
  • 32. Conclusions 1. It is more difficult to solve the table layout problem when there is a large number of rows, columns and column configurations than when the table has a large number of cell configurations; 1. Hardware is essential:The CP engine reported that 1.76 Gb of memory was used to solve a table with 10.000 cells; A New Model for Automated Table Layout Slide 32 of 35
  • 33. Conclusions 1. The constraint programming model may be slower than the MIP model due to the version of the CP engine used in testing. ILOG stopped supporting the CP engine in 2005 but reintroduced it in 2007. Not all search features are available 1. Using a modelling language allows user imposed constraints to be easily added to the model 1. Paragraphing – is an essential step as it impacts on the quality and computational time A New Model for Automated Table Layout Slide 33 of 35
  • 34. Future work To develop a model for tables with • spanning cells • inner tables • other user constraints, i.e. constraints on group of rows/columns Note: We already developed a model for tables with spanning cells ☺ A New Model for Automated Table Layout Slide 34 of 35
  • 35. Acknowledgements We would like to express our gratitude to Prof. David Parnas for motivating much of this work A New Model for Automated Table Layout Slide 35 of 35