Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finset algs #2

Merged
merged 17 commits into from
Mar 5, 2024
Merged

Finset algs #2

merged 17 commits into from
Mar 5, 2024

Conversation

tylerhanks
Copy link
Collaborator

Implemented the translation of a finset algebra to a cospan algebra.
Reimplemented existing code in terms of finset algebras.
Implemented the algebra of network flow graphs and their natural transformation into optimization problems via dual decomposition.
Ran some benchmarks and generated some figures for paper.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 25.07289% with 257 lines in your changes are missing coverage. Please review.

Project coverage is 23.13%. Comparing base (c4fdd8e) to head (081e19e).

Files Patch % Lines
src/Experiments.jl 0.00% 58 Missing ⚠️
src/OpenFlowGraphs.jl 0.00% 54 Missing ⚠️
src/OpenProblems.jl 0.00% 52 Missing ⚠️
src/FlowGraphs.jl 0.00% 44 Missing ⚠️
src/Objectives.jl 39.02% 25 Missing ⚠️
src/FinSetAlgebras.jl 54.71% 24 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main       #2       +/-   ##
===========================================
- Coverage   97.91%   23.13%   -74.78%     
===========================================
  Files           2        8        +6     
  Lines          48      376      +328     
===========================================
+ Hits           47       87       +40     
- Misses          1      289      +288     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

(s::Optimizer)(x::Vector) = s.dynamics(x)
dom(s::Optimizer) = s.state_space

struct ContinuousOpt <: FinSetAlgebra{Optimizer} end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these continuous decision variables or continuous time differentials? Should be in the docstring.

A[v,e] = -1
end
end
return A
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this in linear time with

A = zeros(V,E)
for e in parts(g, :E) 
  A[src(e),e] = 1
  A[tgt(e),e] = -1
end

function draw2(n::Int)
a = rand(1:n)
b = rand(1:n-1)
b += (b >= a)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat?

What process are you trying to sample from?

@tylerhanks tylerhanks merged commit 8b82c9a into main Mar 5, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants