Skip to content

Commit

Permalink
feat: implement problem mask for QUBO
Browse files Browse the repository at this point in the history
  • Loading branch information
schweikart committed Sep 28, 2023
1 parent 9ca8c65 commit bd6acdc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/landing-page/ProblemCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProblemCard = (props: ProblemCardProps) => {
<Box display="flex" alignItems="baseline">
{props.new && (
<Badge borderRadius="full" px="2" colorScheme="blue" mr="2">
New
New!
</Badge>
)}
<Box
Expand Down
11 changes: 10 additions & 1 deletion src/components/landing-page/ProblemChooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ export const ProblemChooser = (props: GridProps) => (
new={false}
tags={["sub-routines"]}
problemName="Feature Model Anomaly"
description="For a given feature model, check for Void Feature Model, Dead Features, False-Optional Features, Redundant Constraints.."
description="Check whether a given feature model in the UVL format is void or if it has dead features."
/>
</GridItem>
<GridItem>
<ProblemCard
href="solve/QUBO"
new={true}
tags={["QAOA"]}
problemName="QUBO"
description="For a quadratic term with binary decision variables, find the variable assignment minimizing the term."
/>
</GridItem>
</Grid>
Expand Down
47 changes: 47 additions & 0 deletions src/pages/solve/QUBO.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import Head from "next/head";
import React, { useState } from "react";
import type { NextPage } from "next";
import { TextArea } from "../../components/solvers/SAT/TextArea";
import { ProgressHandler } from "../../components/solvers/ProgressHandler";
import { Text, Divider, Heading, Spacer, Code } from "@chakra-ui/react";
import { Layout } from "../../components/layout/Layout";
import { EditorControls } from "../../components/solvers/EditorControls";
import { baseUrl } from "../../api/ToolboxAPI";

const QUBO: NextPage = () => {
const [quboTerm, setQuboTerm] = useState("");

return (
<Layout>
<Head>
<title>ProvideQ</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
{/* TODO: replace favicon */}
</Head>

<Heading as="h1">QUBO Solver</Heading>
<Text color="text" align="justify">
In the Quadratic Unconstrained Binary Optimization problem, we try to
find the assignment for a finite amount of <Code>0/1</Code>
decision variables that minimizes a given quadratic term with these
variables. The problem statement is given in the LP format and all
solvers will present a variable assigment as a solution.
</Text>

<Spacer />

<EditorControls
idleText={'Try "a and not (not a or not b)" 👇'}
onUpload={setQuboTerm}
editorContent={quboTerm}
documentationLink={`${baseUrl()}/webjars/swagger-ui/index.html#/qubo`}
/>
<TextArea problemString={quboTerm} setProblemString={setQuboTerm} />
<Divider />
<ProgressHandler problemTypes={["qubo"]} problemInput={quboTerm} />
</Layout>
);
};

export default QUBO;

0 comments on commit bd6acdc

Please sign in to comment.