Skip to content

Memoize link resources and node links with Memoization.jl - #111

Open
hellemo wants to merge 1 commit into
mainfrom
memo-memoization
Open

hellemo wants to merge 1 commit into
mainfrom
memo-memoization

Conversation

@hellemo

@hellemo hellemo commented Oct 17, 2026

Copy link
Copy Markdown
Member

This is one of the alternatives to #110, using Memoization.jl to hide the use of a dictionary to cache results.

Pros:

  • No change to the formulation
  • Benefits all extension packages

Cons:

  • An extra dependency
  • Global state

link_res(l) intersects the resources of the two nodes of a link and was
evaluated for every operational period (index sets of link_in/link_out, the
coupling condition, link constraints); link_sub filtered all links for every
node.  Both are now memoized with Memoization.jl (link_res in a Dict,
link_sub by the identity of the vector of links).  The caches are emptied
before and after create_model, so a later model sees changed nodes and the
caches do not keep a case alive.  No change to the API or to any caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant