Skip to content

Commit

Permalink
orthogonality check added
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha committed Feb 7, 2024
1 parent 164884b commit 3429f79
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
LaplacianOpt.jl Change Log
=========================

### v0.6.2
- Minor fix for testing eigen cut orthogonality if `projected_eigen_cuts` is active

### v0.6.1
- Readme update for dark/light theme logo display
- Fixed Docs compile issue
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LaplacianOpt"
uuid = "bb20392f-64fb-4001-92e8-14b3aedd5a9e"
authors = ["Harsha Nagarajan"]
version = "0.6.1"
version = "0.6.2"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
9 changes: 9 additions & 0 deletions examples/plots/plot_5.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
graph G {
layout=neato;
size="10,5";
node [fontname="Helvetica", fontsize=7, shape = circle, width=0.15, fixedsize=true, style="filled", fillcolor="cyan"];
1 -- 4 [fontsize=9, fontname="Helvetica", len=0.5];
2 -- 4 [fontsize=9, fontname="Helvetica", len=0.5];
3 -- 4 [fontsize=9, fontname="Helvetica", len=0.5];
3 -- 5 [fontsize=9, fontname="Helvetica", len=0.5];
}
52 changes: 52 additions & 0 deletions examples/plots/plot_5.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\documentclass[tikz]{standalone}
\usepackage{fontspec}
\setmainfont{Latin Modern Math}
\usetikzlibrary{arrows}
\usetikzlibrary{graphs}
\usetikzlibrary{graphdrawing}

% from: https://tex.stackexchange.com/questions/453132/fresh-install-of-tl2018-no-tikz-graph-drawing-libraries-found
\usepackage{luacode}
\begin{luacode*}
function pgf_lookup_and_require(name)
local sep = package.config:sub(1,1)
local function lookup(name)
local sub = name:gsub('%.',sep)
if kpse.find_file(sub, 'lua') then
require(name)
elseif kpse.find_file(sub, 'clua') then
collectgarbage('stop')
require(name)
collectgarbage('restart')
else
return false
end
return true
end
return
lookup('pgf.gd.' .. name .. '.library') or
lookup('pgf.gd.' .. name) or
lookup(name .. '.library') or
lookup(name)
end
\end{luacode*}

\usegdlibrary{force}
\begin{document}
\begin{tikzpicture}[]
\graph [spring electrical layout, random seed = 42, electric charge=1.0,, ] {
1/"1" [draw, rounded corners, fill=blue!10],
2/"2" [draw, rounded corners, fill=blue!10],
3/"3" [draw, rounded corners, fill=blue!10],
4/"4" [draw, rounded corners, fill=blue!10],
5/"5" [draw, rounded corners, fill=blue!10],
;
1 -- [,edge label={11.27},] 4;
2 -- [,edge label={13.67},] 4;
3 -- [,edge label={29.12},] 4;
3 -- [,edge label={27.75},] 5;
};

\end{tikzpicture}

\end{document}
4 changes: 3 additions & 1 deletion src/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ function _add_eigen_cut_lazy(

violated_eigen_vec =
LOpt._violated_eigen_vector(W_val[idx, idx], tol = lom.options.tol_psd)

if violated_eigen_vec !== nothing
# Projected eigen-cuts in (x, gamma) space
if lom.options.projected_eigen_cuts
# NxN matrix
if length(idx) == num_nodes
if (length(idx) == num_nodes) &&
(isapprox(abs(sum(violated_eigen_vec)), 0, atol = 1E-6))
con = JuMP.@build_constraint(
sum(
adjacency[i, j] *
Expand Down

0 comments on commit 3429f79

Please sign in to comment.