Skip to content

Commit

Permalink
use GLPK to solve the FES problem
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Mar 4, 2019
1 parent 95d0853 commit e197df3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
'colorlog',
'tqdm',
'dataclasses',
'cvxpy'
'cvxpy',
'cvxopt' # just used to pull in GLPK
],
entry_points={
'console_scripts': ['macrogen=macrogen.main:main']
Expand Down
7 changes: 2 additions & 5 deletions src/macrogen/etc/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ render_node_limit: 1000
fes_method: baharev # ip, baharev: exact methods; eades: inexact, list of two: select by fes_threshold
fes_threshold: 64 # if two fes_methods, number of edges above which to select the second one
solvers: # the first installed solver is chosen. see log message for values.
- GUROBI
- auto # auto = let CVXPY choose
- GLPK_MI
solver_options:
all:
max_iters: 10000


verbose: false
## Other data
namespaces:
f: http://www.faustedition.net/ns
Expand Down
12 changes: 6 additions & 6 deletions src/macrogen/etc/logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ root:
level: WARNING

loggers:
macrogen.visualize:
level: INFO
# macrogen.visualize:
# level: INFO
macrogen.fes:
level: DEBUG
macrogen.graph:
level: DEBUG
# macrogen.graph:
# level: DEBUG
# macrogen.uris:
# level: INFO
# macrogen.datings:
# level: INFO
macrogen.config:
level: INFO
# macrogen.config:
# level: INFO
4 changes: 2 additions & 2 deletions src/macrogen/fes.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ def solve(self):
problem.solver_stats.solver_name)
logger.debug("Solved optimization problem with %d constraints: %s -> %s (%g + %g seconds, %d iterations, solver %s)",
len(constraints), resolution, problem.solution.status,
problem.solver_stats.solve_time, problem.solver_stats.setup_time or 0,
problem.solver_stats.num_iters, problem.solver_stats.solver_name)
problem.solver_stats.solve_time or 0, problem.solver_stats.setup_time or 0,
problem.solver_stats.num_iters or 0, problem.solver_stats.solver_name)
current_solution = np.abs(y.value) >= 0.5
S = self.edges_for_vector(current_solution)
logger.debug('Iteration %d, resolution: %s, %d feedback edges', iteration, resolution, len(S))
Expand Down

0 comments on commit e197df3

Please sign in to comment.