cudd  3.0.0
The University of Colorado Decision Diagram Package
Macros | Functions
cuddAnneal.c File Reference

Reordering of DDs based on simulated annealing. More...

#include "util.h"
#include "cuddInt.h"
Include dependency graph for cuddAnneal.c:

Macros

#define BETA   0.6
 
#define ALPHA   0.90
 
#define EXC_PROB   0.4
 
#define JUMP_UP_PROB   0.36
 
#define MAXGEN_RATIO   15.0
 
#define STOP_TEMP   1.0
 

Functions

int cuddAnnealing (DdManager *table, int lower, int upper)
 Get new variable-order by simulated annealing algorithm. More...
 
static int stopping_criterion (int c1, int c2, int c3, int c4, double temp)
 Checks termination condition. More...
 
static double random_generator (DdManager *dd)
 Random number generator. More...
 
static int ddExchange (DdManager *table, int x, int y, double temp)
 Exchanges two variables, x and y. More...
 
static int ddJumpingAux (DdManager *table, int x, int x_low, int x_high, double temp)
 Moves a variable to a specified position. More...
 
static MoveddJumpingUp (DdManager *table, int x, int x_low, int initial_size)
 This function is for jumping up. More...
 
static MoveddJumpingDown (DdManager *table, int x, int x_high, int initial_size)
 This function is for jumping down. More...
 
static int siftBackwardProb (DdManager *table, Move *moves, int size, double temp)
 Returns the DD to the best position encountered during sifting if there was improvement. More...
 
static void copyOrder (DdManager *table, int *array, int lower, int upper)
 Copies the current variable order to array. More...
 
static int restoreOrder (DdManager *table, int *array, int lower, int upper)
 Restores the variable order in array by a series of sifts up. More...
 

Detailed Description

Reordering of DDs based on simulated annealing.

Author
Jae-Young Jang, Jorgen Sivesind

Function Documentation

◆ copyOrder()

static void copyOrder ( DdManager table,
int *  array,
int  lower,
int  upper 
)
static

Copies the current variable order to array.

At the same time inverts the permutation.

Side effects None

◆ cuddAnnealing()

int cuddAnnealing ( DdManager table,
int  lower,
int  upper 
)

Get new variable-order by simulated annealing algorithm.

Get x, y by random selection. Choose either exchange or jump randomly. In case of jump, choose between jump_up and jump_down randomly. Do exchange or jump and get optimal case. Loop until there is no improvement or temperature reaches minimum.

Returns
1 in case of success; 0 otherwise.
Side effects None

◆ ddExchange()

static int ddExchange ( DdManager table,
int  x,
int  y,
double  temp 
)
static

Exchanges two variables, x and y.

This is the same funcion as ddSwapping except for the comparison expression. Use probability function, exp(-size_change/temp).

Side effects None

◆ ddJumpingAux()

static int ddJumpingAux ( DdManager table,
int  x,
int  x_low,
int  x_high,
double  temp 
)
static

Moves a variable to a specified position.

If x==x_low, it executes jumping_down. If x==x_high, it executes jumping_up. This funcion is similar to ddSiftingAux.

Returns
1 in case of success; 0 otherwise.
Side effects None

◆ ddJumpingDown()

static Move* ddJumpingDown ( DdManager table,
int  x,
int  x_high,
int  initial_size 
)
static

This function is for jumping down.

This is a simplified version of ddSiftingDown. It does not use lower bounding.

Returns
the set of moves in case of success; NULL if memory is full.
Side effects None

◆ ddJumpingUp()

static Move* ddJumpingUp ( DdManager table,
int  x,
int  x_low,
int  initial_size 
)
static

This function is for jumping up.

This is a simplified version of ddSiftingUp. It does not use lower bounding.

Returns
the set of moves in case of success; NULL if memory is full.
Side effects None

◆ random_generator()

static double random_generator ( DdManager dd)
static

Random number generator.

Returns
a double precision value between 0.0 and 1.0.
Side effects None

◆ restoreOrder()

static int restoreOrder ( DdManager table,
int *  array,
int  lower,
int  upper 
)
static

Restores the variable order in array by a series of sifts up.

Returns
1 in case of success; 0 otherwise.
Side effects None

◆ siftBackwardProb()

static int siftBackwardProb ( DdManager table,
Move moves,
int  size,
double  temp 
)
static

Returns the DD to the best position encountered during sifting if there was improvement.

Otherwise, "tosses a coin" to decide whether to keep the current configuration or return the DD to the original one.

Returns
1 in case of success; 0 otherwise.
Side effects None

◆ stopping_criterion()

static int stopping_criterion ( int  c1,
int  c2,
int  c3,
int  c4,
double  temp 
)
static

Checks termination condition.

If temperature is STOP_TEMP or there is no improvement then terminates.

Returns
1 if the termination criterion is met; 0 otherwise.
Side effects None