Algebraic modeling in datalog - PowerPoint PPT Presentation

About This Presentation
Title:

Algebraic modeling in datalog

Description:

Diego Klabjan, Jun Ma, Robert Fourer Northwestern University * * * * * * * * * * * * * * * * * * * * Data query languages SQL, Xquery No procedural or declarative ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 23
Provided by: Dieg94
Learn more at: https://www.coin-or.org
Category:

less

Transcript and Presenter's Notes

Title: Algebraic modeling in datalog


1
Algebraic modeling in datalog
  • Diego Klabjan, Jun Ma, Robert Fourer
    Northwestern University

2
Datalog
  • Data query languages
  • SQL, Xquery
  • No procedural or declarative abilities
  • Procedural and declarative languages
  • No data querying capabilities
  • Best of both worlds

DATALOG
3
Algebraic Modeling
4
SQL
  • Modeling in SQL by Linderoth, Atamturk,
    Savelsbergh
  • SQL mainly about querying
  • Not suited for algebraic modeling
  • Everything stored in tables
  • Variables
  • Constraints
  • Modeling non intuitive

5
Modeling in Datalog
  • Powerful data capabilities
  • Superset of SQL
  • Data from database
  • Querying and loading
  • Declarative language
  • Natural constructs
  • Intuitive
  • Hardly any development effort

6
Modeling in datalog
  • Given values to decision variables
  • Easy to check feasibility
  • Clearly not optimality
  • Underlying logic programming in Datalog
  • No extra effort required
  • Not the case for most other algebraic modeling
    languages

7
Basic building blocks (Diet problem)
  • Index sets
  • NUTR(x), NUTRname(xn) -gt string(n). FOOD(x),
    FOODname(xn) -gt string(n).
  • Parameters
  • Input data
  • Variables
  • Buyf b -gt FOOD(f), float64(b),bgt0.

amtn, f a -gt NUTR(n), FOOD(f), float64(a),
a gt 0. nutrLown nL -gt NUTR(n),
float64(nL), nL gt 0. costf c -gt FOOD(f),
float64(c), c gt 0.
8
Production/transportation model
  • Multiple products (PROD), plants (ORIG) and
    destinations (DEST)
  • Ship from plants to destinations
  • Transportation problem for each product

9
Production/transportation model
  • Limited production capacity at each plant
  • Objective to minimize production and
    transportation costs

10
Datalog Model
  • Sets
  • Data

11
Datalog model
  • Input parameters

12
Datalog model
  • Variables
  • How much to transport
  • How much to produce
  • Other variables
  • Integer replace float with int
  • Binary are integer with upper bound of 1

13
Datalog model
  • Production availability
  • sumTime predicate captures the left-hand side
  • agg built-in aggregator
  • Constraint negated (stratification restrictions
    of Datalog)

14
Datalog model
  • Demand constraints

15
Datalog model
  • Supply constraints

16
Datalog model
  • Objective function
  • Production cost
  • Transportation cost

17
Total cost
  • Sum of the two cost components

18
Enhanced modeling capabilities
  • The fleeting model
  • Assign fleets to flights
  • Modeled as a multi-commodity network flow problem
  • Network aspects
  • Challenges
  • Nodes at each airports sorted based on the
    arrival/departure time in a circular fashion
  • Ordered and circular lists

19
Flights
  • Specification of flights
  • Leg(l), Legname(ln) -gt string(n).
  • Legtable(s1,t1,s2,t2,l) -gtStation(s1), Time(t1),
    Station(s2), Time(t2), Leg(l).
  • LegtabledStationls1 -gtStation(s1), Leg(l).
  • LegtabledTimelt1 -gt Time(t1), Leg(l).
  • LegtableaStationls2 -gtStation(s2), Leg(l).
  • LegtableaTimelt2 -gt Time(t2), Leg(l).

20
NETWORk nodes
  • For each station there is a timeline consisting
    of network nodes
  • Either arrival or departure at station

node(s,t) -gt Station(s), Time(t). node(s,t) lt-
Legtable(s1,t1,_,_,_),(ss1, tt1)Legtable(_,_,
s2,t2,_),(ss2, tt2).
21
Ordered Circular lists
  • Declare next in the list
  • Time is an integer-like structure to capture
    times
  • nodenxts,t1 t2 -gt Station(s), Time(t1),
    Time(t2).
  • Order
  • nodenxts,t1 t2 lt- node(s,t1), node(s,t2),
    (Timedatetimet1ltTimedatetimet2,!anythingInBe
    tween(s, t1,t2) nodefrstst2,
    nodelstst1).

22
Missing aspects
  • Piecewise linear functions
  • Model them explicitly
  • Unfortunately OS cannot handle them explicitly
  • LogicBlox needs to convert them into a linear
    mixed integer program
  • Disjunctions
  • Nonlinear functions
  • Long term goal
Write a Comment
User Comments (0)
About PowerShow.com