https://github.com/algebraicjulia/algebraicoptimization.jl

https://github.com/algebraicjulia/algebraicoptimization.jl

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
Statistics
  • Stars: 13
  • Watchers: 3
  • Forks: 4
  • Open Issues: 14
  • Releases: 0
Created almost 3 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

AlgebraicOptimization.jl

Stable Documentation Development Documentation Code Coverage CI/CD

This package is designed for building large optimization problems out of simpler subproblems and automatically compiling them to a distributed solver.

Basic Usage

The most simple use of this package is making and solving a composite optimization problem. For example, say we have three subproblems whose objectives are given by some random quadratic cost functions: ```julia using AlgebraicOptimization using Catlab

Problem parameters.

P = [2.1154 -0.3038 0.368 -1.5728 -1.203 -0.3038 1.5697 1.0226 0.159 -0.946 0.368 1.0226 1.847 -0.4916 -1.2668 -1.5728 0.159 -0.4916 2.2192 1.5315 -1.203 -0.946 -1.2668 1.5315 1.9281] Q = [0.2456 0.3564 -0.0088 0.3564 0.5912 -0.0914 -0.0088 -0.0914 0.8774] R = [2.0546 -1.333 -0.5263 0.3189 -1.333 1.0481 -0.0211 0.2462 -0.5263 -0.0211 0.951 -0.7813 0.3189 0.2462 -0.7813 1.5813]

a = [-0.26, 0.22, 0.09, 0.19, -0.96] b = [-0.72, 0.12, 0.41] c = [0.55, 0.51, 0.6, -0.61]

Subproblem objectives.

A PrimalObjective wraps an objective function with its input dimension.

f = PrimalObjective(FinSet(5),x->x'Px + a'x) g = PrimalObjective(FinSet(3),x->x'Qx + b'x) h = PrimalObjective(FinSet(4),x->x'Rx + c'*x) ```

Now, to compose these subproblems, we need to make them into open problems. An open problem specifies which components of a problem's domain are open to composition with other problems. We do this as follows: ```julia

Make open problems.

The first argument is the primal objective we are wrapping, the second argument is a function

specifying which components of the objective are exposed.

p1 = Open{PrimalObjective}(FinSet(5), PrimalObjective(FinSet(5),f), FinFunction([2,4], 5)) p2 = Open{PrimalObjective}(FinSet(3), PrimalObjective(FinSet(3),g), id(FinSet(3))) p3 = Open{PrimalObjective}(FinSet(4), PrimalObjective(FinSet(4),h), FinFunction([1,3,4])) ```

To specify the composition pattern of our subproblems, we use Catlab's relation macro to make an undirected wiring diagram and oapply to compose our subproblems. ```julia d = @relation_diagram (x,y,z) begin f(u,x) g(u,w,y) h(u,w,z) end

composite_prob = oapply(d, [p1,p2,p3]) ```

Now, we can solve the composite problem with distributed gradient descent: ```julia

Arguments are problem, initial guess, step size, and number of iterations

sol = solve(composite, repeat([100.0], dom(composite_prob).n), 0.1, 100) ``` Currently, we just support unconstrained and equality constrained problems with plans to add support for inequality constrained and disciplined convex programs.

More complete documentation and quality of life improvements are also on the way.

This package is an implementation of A Compositional Framework for First-Order Optimization.

Owner

  • Name: AlgebraicJulia
  • Login: AlgebraicJulia
  • Kind: organization

GitHub Events

Total
  • Issues event: 2
  • Watch event: 6
  • Delete event: 8
  • Issue comment event: 8
  • Push event: 115
  • Pull request review comment event: 3
  • Pull request review event: 7
  • Pull request event: 47
  • Create event: 28
Last Year
  • Issues event: 2
  • Watch event: 6
  • Delete event: 8
  • Issue comment event: 8
  • Push event: 115
  • Pull request review comment event: 3
  • Pull request review event: 7
  • Pull request event: 47
  • Create event: 28

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 2
  • Total pull requests: 56
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Total issue authors: 1
  • Total pull request authors: 8
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.21
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 35
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Issue authors: 1
  • Pull request authors: 6
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.29
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jpfairbanks (2)
Pull Request Authors
  • algebraicjuliabot (34)
  • tylerhanks (16)
  • samuelcohen1 (13)
  • quffaro (2)
  • cscaff (2)
  • GrossTrevor (2)
  • samuelsonric (1)
  • jpfairbanks (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/julia_ci.yml actions