Opened 15 years ago
Closed 15 years ago
#327 closed defect (fixed)
Network Simplex doesn't handle graph changes.
Reported by: | Alpar Juttner | Owned by: | Peter Kovacs |
---|---|---|---|
Priority: | major | Milestone: | LEMON 1.2 release |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: | 1a7fe3bef514 |
Description
The NetworkSimplex
class crashes is the graph is changed after its construction, even if it takes place before the first upperMap()
, lowerMap()
etc invocation. The problem with this is that if it is a member or the class, them it must be constructed when the parent class is constructed and the corresponding graph may be empty at that time.
I see the implementation difficulties here, but at least the reset()
member function could take care of it.
And the doc should be very clear about this issue, of course.
Attachments (1)
Change History (12)
comment:1 follow-up: 3 Changed 15 years ago by
Revision id: | → 1a7fe3bef514 |
---|
comment:2 Changed 15 years ago by
Status: | new → assigned |
---|
Replying to alpar:
The
NetworkSimplex
class crashes is the graph is changed after its construction, even if it takes place before the firstupperMap()
,lowerMap()
etc invocation.
Definitely. See the doc of its run()
and reset()
functions: "However, the underlying digraph must not be modified after this class have been constructed, since it copies and extends the graph.".
The problem with this is that if it is a member or the class, them it must be constructed when the parent class is constructed and the corresponding graph may be empty at that time.
I see. However, this problem can be overcome using a dynamically created instance of NetworkSimplex
, though it is bit less convenient.
I see the implementation difficulties here, but at least the
reset()
member function could take care of it.And the doc should be very clear about this issue, of course.
I think, it is absolutely clear (see above). However, this note could be underlined more. E.g. we can add it to the doc of the class itself, not only to the doc of run()
and reset()
.
Note that the same issue will present for all the other MCF classes if they are merged (see #180).
comment:3 Changed 15 years ago by
Replying to alpar:
If there are performance issues, the we might want more reset functions:
Performance is a real issue here, since copying the graph is not a cheap operation.
reset()
- reset everythingresetParams()
- this would do whatreset()
currently does.Alternatively we can keep
reset()
as is, plus implementresetAll()
.
I prefer the second solution (to keep compatbility). It would be a clear extension to the current interface.
comment:4 Changed 15 years ago by
Milestone: | → LEMON 1.2 release |
---|
comment:5 follow-up: 6 Changed 15 years ago by
Could you help to make decision about the names? Which one do you find the best? Do you have other idea?
reset()
+resetGraph()
(orresetDigraph()
)reset()
+resetAll()
orfullReset()
resetParams()
+reset()
Currently, I sligthly prefer using reset()
and fullReset()
.
comment:6 Changed 15 years ago by
Replying to kpeter:
Could you help to make decision about the names? Which one do you find the best? Do you have other idea?
reset()
+resetGraph()
(orresetDigraph()
)reset()
+resetAll()
orfullReset()
resetParams()
+reset()
Currently, I sligthly prefer using
reset()
andfullReset()
.
I would prefer resetParams()/reset()
, but not object these ones either.
comment:7 follow-up: 8 Changed 15 years ago by
Shall we expect this feature to be implemented in the near future? Or should we postpone it to 1.3?
comment:8 follow-up: 9 Changed 15 years ago by
comment:9 Changed 15 years ago by
comment:10 follow-up: 11 Changed 15 years ago by
The attached patch [75c97c3786d6] realizes these changes for all the four MCF classes.
Now reset()
resets all the internal data structures, makes a copy of the digraph and resets all parameters (maps). resetParams()
resets only the parameters, thus it is significantly faster. The latter one is what was called reset()
until now.
Changed 15 years ago by
Attachment: | 327-mcf-reset-75c97c3786d6.patch added |
---|
comment:11 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to kpeter:
The attached patch [75c97c3786d6] realizes these changes for all the four MCF classes.
It is in the main branch now.
If there are performance issues, the we might want more reset functions:
reset()
- reset everythingresetParams()
- this would do whatreset()
currently does.Alternatively we can keep
reset()
as is, plus implementresetAll()
.