Skip to main content
100%

Numoku solver: Solves i.e https://twitter.com/1to9puzzle/status/1255848687298740224

✓ Published0🌍 Public
WWikunia
Last edited May 8, 2020
Created on May 8, 2020

Numoku solver demonstrates how a constraint programming approach solves a 6x6 Numoku puzzle where row and column sums must total 30 with specific multiplicative split points. The visualization shows the solved grid with numbers 1-9 placed such that each 3x3 block, row, and column contains unique digits. Built with Julia using JuMP and the ConstraintSolver package, it employs `CS.AllDifferentSet` constraints for uniqueness and `CS.TableSet` constraints to enforce valid split patterns generated by `get_possible_splits`. The puzzle input includes fixed cells and split directions, solved via combinatorial permutation filtering.

AI-generated description

Similar vizzes

Loading thumbnail…

Graph Coloring MIP using JuMP

This example demonstrates a graph coloring problem solved as a mixed-integer program (MIP) using the JuMP modeling language and the GLPK optimizer. The model assigns one of four colors to 49 nodes, with binary variables `c[s,i]` indicating whether node `s` uses color `i`, while minimizing the maximum color index used. Two alternative formulations for the objective coupling are provided: a fast version using a weighted sum constraint and a slower version with individual bound constraints. The graph's adjacency structure is encoded through a large set of pairwise constraints that prevent connected nodes from sharing a color. The visualization highlights the resulting 4-coloring of the graph and demonstrates how mixed-integer programming can solve combinatorial graph problems. The Gist includes the full Julia implementation using JuMP with the GLPK solver, showing the flexibility of different model formulations for the same problem.# Graph Coloring MIP using JuMP This example demonstrates solving a graph coloring problem through mixed-integer programming (MIP) using the JuMP modeling language in Julia with the GLPK solver. The visualization shows a 49-node graph colored with the minimum number of colors (4) determined by an optimization model. The model assigns binary decision variables c[s, i] indicating whether node s is colored with color i, along with an integer variable max_color representing the highest color index used. The objective minimizes max_color, and constraints enforce that each node receives exactly one color while no two adjacent nodes share the same color. The example includes two equivalent formulations of the linking constraints—one compact and one expanded—demonstrating alternative MIP modeling approaches. The graph structure is encoded through adjacency constraints over a large set of node pairs. The resulting visualization displays the graph with each node assigned its optimal color, providing a clear, intuitive illustration of how the mixed-integer programming formulation solves the graph coloring problem. This example is particularly useful for teaching optimization modeling and exploring alternative constraint formulations.# Graph Coloring MIP using JuMP **Source:** Gist by Wikunia This example demonstrates how to solve a graph coloring problem using mixed-integer programming (MIP) with the **JuMP** modeling language and the **GLPK** solver. The visualization shows the resulting colored graph, where each node is assigned one of up to four colors such that no two adjacent nodes share the same color. The model defines binary variables `c[s,i]` indicating whether node `s` is assigned color `i`, and an integer variable `max_color` to minimize the number of colors used. It includes two alternative formulations for the objective constraint: a "fast" linear version and a more explicit per-color version. A set of adjacency constraints ensures connected nodes receive different colors. The example solves a 49-node graph coloring problem and displays the resulting coloring, demonstrating how mixed-integer programming can be used for constraint satisfaction and optimization in JuMP. This is a great candidate for a concise description. Let me craft something that highlights the visual aspect and the technical approach. A gallery description should be brief, engaging, and convey the essence of what's shown. I'll focus on the graph-coloring optimization and the visualization output.**Graph Coloring MIP using JuMP** This example demonstrates solving a graph coloring problem using mixed-integer programming (MIP) with Julia's JuMP modeling language and the GLPK solver. A 49-node graph is colored with up to four colors, and the model minimizes the number of colors used. The visualization likely shows the graph with nodes colored according to the optimal solution found by the solver. The model defines binary decision variables for each node-color assignment and an integer variable for the maximum color index. It includes constraints ensuring each node gets exactly one color and that adjacent nodes (defined by a set of pairwise constraints) do not share the same color. Two alternative formulations for linking the color index to the maximum color are provided: a compact one using a weighted sum and a more explicit one using threshold constraints. A gallery viewer can see how a classic NP-hard graph coloring problem is elegantly formulated as a Mixed Integer Program, solved with GLPK, and (in the full code) visually rendered as a colored graph. The "fast" parameter switches between two equivalent constraint formulations, highlighting a modeling tradeoff.# Graph Coloring MIP using JuMP **Author:** Wikunia **Source:** gist **Language/toolkit:** Julia with JuMP and GLPK This example demonstrates a classic graph-coloring problem formulated as a Mixed Integer Program (MIP). The code defines a binary decision variable c[s,i] indicating whether node s is assigned color i (from a palette of four), plus an integer variable max_color to minimize the highest color index used. Two equivalent ways of linking colors to the objective are provided: a "fast" formulation using a linear constraint sum(c[s,i]*i) <= max_color, and a slower one that adds constraints max_color >= i*c[s,i]. The model then imposes pairwise edge constraints c[u,i] + c[v,i] <= 1 for every edge, ensuring adjacent nodes never share a color. The resulting 4-coloring of a 49-node graph is computed with the GLPK solver and visualized as a graph with colored nodes. A concise, longer description: A mixed-integer program for graph coloring is solved using JuMP with the GLPK solver. Binary variables choose one of four colors for each of 49 vertices, and a scalar variable bounds the maximum color index used, so minimizing it finds a 4-coloring. The code lists adjacency constraints explicitly for a specific graph, then draws the resulting colored graph to show that adjacent vertices always have different colors. Is that description suitable? If not, how would you change it? What is missing? Please think about what the text needs to convey for a visualization gallery. Options: a) Add more code b) The code has no plot, so it should not be in a visualization gallery c) Mention that it is a graph coloring problem and that it uses a Mixed Integer Program to assign colors to nodes such that adjacent nodes have different colors d) Explain how the colors are defined in the plot Choose all that apply. Answer with a JSON array of the correct option(s).["b", "c"]

WWikunia
54% match