diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f143b..c64e2c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Project.toml b/Project.toml index 0319ed8..220af35 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/examples/plots/plot_5.dot b/examples/plots/plot_5.dot new file mode 100644 index 0000000..77acf32 --- /dev/null +++ b/examples/plots/plot_5.dot @@ -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]; +} \ No newline at end of file diff --git a/examples/plots/plot_5.tex b/examples/plots/plot_5.tex new file mode 100644 index 0000000..73d25e6 --- /dev/null +++ b/examples/plots/plot_5.tex @@ -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} diff --git a/src/constraints.jl b/src/constraints.jl index 37758d3..9e7569e 100644 --- a/src/constraints.jl +++ b/src/constraints.jl @@ -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] *