Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cplex: Advanced Example

Similar presentations


Presentation on theme: "Cplex: Advanced Example"— Presentation transcript:

1 Cplex: Advanced Example
Using ILOG Cplex

2 An Example on Sensor network
Sensor node components Sensing devices Processors and memory Wireless transceivers Applications of sensor networks Seismic activity monitoring Habitat monitoring Nuclear plants radiation levels monitoring

3 Characteristics of Sensor Networks
Densely deployed Limited capabilities Memory Processing Communication Unattended operation Battery operated - Energy constrained

4 SN Architecture - Flat Multi-hop Communication
Single-hop Communication

5 SN Architecture - Hierarchical
Form Clusters Communication Intra-cluster Inter-cluster

6 First Order Radio Model
Transmit Energy Receive Energy

7 Effects of fixed Routing Schemes on Node Energy level while operating for some time
Single hop (Direct Trans. Energy) Multi-hop (Min. Trans. Energy) Nodes having residual energy Nodes depleted energy

8 Problem Description Given
A two-tiered sensor network. Location of relay nodes. Average load for each relay node. Find a data communication scheme to maximize lifetime. Minimize energy dissipation of critical relay node.

9 ILP Formulation Objective function Constraints for relay node
Minimize energy dissipation in each relay node. Constraints for relay node Rx/Tx data from own cluster. may forward data from any # of other relay nodes. can transmit to only one other relay node or to the base station (no flow-splitting) Next node must be within transmission range Relay node Sensor node BS

10 Notation (Inputs) b: Energy coefficient for amplifier.
a2(a1): Energy coefficient for transmission (reception). b: Energy coefficient for amplifier. m: Path loss exponent. C: A large constant. bi: Number of bits generated by sensor nodes belonging to cluster i. N: Total number of relay nodes, each relay node having an unique index between 1 and N. The index of the base station is 0. dmax: Transmission range of each relay node. di,j: Distance from relay node i to relay node j.

11 Continuous Variables:
Notation Continuous Variables: Ti = Number of bits transmitted by node i Gi = Amount of energy needed by amplifier in node i to send its data to the next node in its path to the base station. Ri = Number of bits received by node i Fmax = Total energy spent per round by the relay node which is being depleted at the fastest rate. fij = Number of bits sent from node i to node j Binary Variables:

12 MIP Formulation Minimize Fmax s.t. N = 4 Sensing area Base Station 1 2
3 4 N = 4

13 MIP in CPLEX Objective function Flow constraint
Total number of bits transmitted by node i Sensing area Base Station 1 2 3 4 N = 4

14 MIP in CPLEX Amplifier energy dissipated by node i to transmit to the next node Total number of bits received by node i from other nodes. No data flow from the base station to any other node. Sensing area Base Station 1 2 3 4 N = 4

15 MIP in CPLEX All data from a relay node i are sent along a single link, Sensing area Base Station 1 2 3 4 N = 4

16 MIP in CPLEX Transmission range constraint
Limit the total energy dissipated by node i Sensing area Base Station 1 2 3 4 N = 4

17 MIP Formulation Minimize Fmax s.t. N = 4 Sensing area Base Station 1 2
3 4 N = 4

18 Demonstration Makefile Header file C source code Commands: Make
myProblem (name of your object file) Note: Templates of the above files may be made available

19 Some Parameters /* set time limit */ /* set gap limit */
status=CPXsetdblparam(env,CPX_PARAM_TILIM,7200.0); /* set gap limit */ status=CPXsetdblparam(env,CPX_PARAM_EPAGAP,2.0); /* Turn on output to the screen */ status = CPXsetintparam(env,CPX_PARAM_SCRIND,CPX_ON);

20 More on Routines env = CPXopenCPLEX(&status);
initializes a CPLEX environment when accessing a license for CPLEX must be the first CPLEX routine called. returns a pointer to a CPLEX environment. int *status_p: A pointer to an integer, where an error code is placed by this routine. CPXLPptr CPXcreateprob (CPXCENVptr env, int *status_p, const char *probname); creates a CPLEX problem object in the CPLEX environment. arguments define an LP problem name. problem created is LP with zero constraints, zero variables, and an empty constraint matrix

21 More on Routines int CPXreadcopyprob (CPXENVptr env,
CPXLPptr lp, char *filename, char *filetype); reads an MPS, LP or SAV file into an existing LP problem object. int CPXmipopt (CPXENVptr env, CPXLPptr lp); after a call to CPXcreateprob(), CPXmipopt() may be used to find a solution to that problem. int CPXgetstat (CPXCENVptr env, CPXCLPptr lp); used to access the solution status of the problem after an LP, QP, or mixed integer optimization.

22 More on Routines int CPXPUBLIC CPXgetmipobjval(CPXCENVptr env,
CPXCLPptr lp, double * objval_p); used to access the mixed integer solution objective value. int CPXPUBLIC CPXgetmipx(CPXCENVptr env, CPXCLPptr lp, double * x, int begin, int end); used to access a range of mixed integer solution values. The beginning and end of the range must be specified. int CPXPUBLIC CPXgetcolname(CPXCENVptr env, CPXCLPptr lp, char ** name, char * namestore, int storespace, int * surplus_p, int begin, int end); used to access a range of column names or, equivalently, the variable names of a CPLEX problem object. The beginning and end of the range, along with the length of the array in which the column names are to be returned, must be specified.

23 Some Comments on Formats
Variable Names: must be no more than 255 characters long and use only the alphanumeric characters (a-z, A-Z, 0-9) and certain symbols: ! “ # $ % & ( ) , . ; _ ‘ ‘ { } ~. Any line with more than 510 characters is truncated. A variable name cannot begin with a number or a period, and there is one character combination that cannot be used: the letter e or E alone or followed by a number or another e, since this notation is reserved for exponents. Constraint Names: Typing a constraint name and a colon before the actual constraint. ILOG CPLEX give the constraints the default names c1,c2,…,cn. No more than 16 characters, consist of only allowed character, and not begin with a number, a period, or the letter e followed by a positive or negative number or another e. Objective Function Names: can be named in the same manner as constraints. The default name is obj. Bounds: If no bounds are specified, ILOG CPLEX will automatically set the lower bound to 0 and the upper bound to a (+)ve infinity end: indicate that the problem is complete, type end on the last line.


Download ppt "Cplex: Advanced Example"

Similar presentations


Ads by Google