> > ILOG CPLEX File Formats > NET File Format |
NET File Format |
INDEX PREVIOUS NEXT |
The NET file format is an ASCII file format specific to ILOG CPLEX for network-flow problems. It is the recommended file format for representing pure network problems within CPLEX. This format is supported by the Callable Library and by the Interactive Optimizer (not by Concert Technology). In particular, it works with CPXNETptr
objects (not CPXLPptr
objects).
This is a free-format file; that is, line breaks or column positions are irrelevant to the interpretation of the file. The only exceptions to this convention are comments: anything from a backslash (\) character to the end of a line is a comment and does not contribute to the network specified by the file. Comments are allowed anywhere in the file.
The NET format recognizes the following keywords in a file:
Keywords are independent of character case. Keywords must be separated by white space from other symbols in the file.
White space consists of one or more of the following:
Also, the NET format recognizes the abbreviations summarized in Table 5.
Keyword |
Abbreviation |
---|---|
INFINITY | INF |
MINIMIZE | MIN |
MAXIMIZE | MAX |
A NET file must start with one of the following keywords:
Both may be followed optionally by the name of a problem. If no name is specified, the filename will be used instead. This part of a NET file is referred to as the start of a NET file.
Names must follow the same conventions as they do for CPLEX LP format files. They must consist of a sequence of alphanumeric characters (a-z, A-Z, or 0-9) or one of the symbols: ! " # $ % & ( ) / , . ; @ _ ` \Q { } | ~. However, the first character may not be a digit or period (.). No names corresponding to the keywords are allowed. There is no restriction on the number of characters in a name within a NET file.
The network specification of a NET file must end with the keyword ENDNETWORK
. Anything following the keyword ENDNETWORK
will be ignored. This keyword is referred to as the end of a NET file.
Between its start and end, a NET file is devided into sections. Each section is introduced by its keyword and continues until the next section begins or the NET file ends. The keywords introducing sections are SUPPLY
, DEMAND
, ARCS
, BOUNDS
, and OBJECTIVE
. Each section keyword may appear more than once in a NET file. They need not be in any order.
In this section, supply values for nodes are specified. Each supply value is specified with the following sequence:
node-name : value
where node-name
specifies the name of the node for which to set a supply value, and value
is the value that will be assigned to node node-name
as its supply value. If a node with this name does not already exist, a new node will be created with this name. If the node has been previously assigned a supply value, the new value overrides the previous value, and a warning will be issued.
This section corresponds to the SUPPLY
section except that it specifies demand values instead of supply values. That is, instead of specifying a supply value s in the SUPPLY
section, you can specify the negative of s in the DEMAND
section and vice versa. The format for doing so is exactly the same: node-name : value
. There is no requirement to use both a SUPPLY
and a DEMAND
section in a given model. You can fully specify any model using either of the section types alone by correctly using positive and negative values. The availability of either or both section types simply offers flexibility in model formulation.
In this section, the arcs from-node (or tail) and to-node (or head) are specified. For each arc, the format is:
arc-name : from-node -> to-node
where arc-name
specifies the name for the arc from from-node
to to-node
. If arc-name
already exists, a warning message is issued, and the specified nodes override the previous ones. The nodes are referred to by node names. If a node does not yet exist, a new node with this name will be created with supply value 0 (zero). Otherwise, the existing node of the specified name will be used.
This section is used to assign objective values to arcs in the format:
arc-name : value
where arc-name
must be the name of an arc that has previously been specified in an ARCS
section. This arc will be assigned the objective value indicated by value
. If an arc is assigned an objective value more than once, a warning message will be issued, and the most recently assigned objective value for that arc in the file will be used. If no objective value is specified for an arc, 0 (zero) will be used by default.
In this section, bounds on the flow through an arc are specified in a variety of ways, similar to specifying bounds on variables in LP format. The general format is:
value1 <= arc-name <= value2
That general statement assigns a lower bound of value1
and an upper bound of value2
to the arc named arc-name
. This arc must have previously been defined in an ARCS
section.
Only one bound at a time may be specified for an arc. That is, the following are valid inputs: value <= arc-name
to set the lower bound of the specified arc to value
or arc-name <= value
to set the upper bound of the specified arc to value
. If the upper and lower bound for an arc are identical, you can write arc-name = value
instead.
Bound values may be INFINITY
or -INFINITY
. An arc with lower bound -INFINITY
and upper bound INFINITY
may be entered as FREE
, like this: arc-name free
If a bound is not specified for an arc, 0 (zero) will be used as the default lower bound and infinity as the default upper bound.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |