Skip to content

Add GML object format#37

Merged
schweikart merged 11 commits intodevelopfrom
feat/gml-format
Jul 30, 2023
Merged

Add GML object format#37
schweikart merged 11 commits intodevelopfrom
feat/gml-format

Conversation

@Elscrux
Copy link
Copy Markdown
Member

@Elscrux Elscrux commented Jul 8, 2023

This adds GML as the output format for MaxCut solvers using a new object format of GML.

@Elscrux Elscrux requested a review from schweikart July 8, 2023 16:51
@schweikart
Copy link
Copy Markdown
Member

When I enter the following demo problem, the labels are converted to strings and double-quoted. I don't think we can avoid the conversion to strings but the double-quote should not be necessary:

graph [
    id 42
    node [
        id 1
        label "1"
    ]
    node [
        id 2
        label "2"
    ]
    node [
        id 3
        label "3"
    ]
    edge [
        source 1
        target 2
    ]
    edge [
        source 2
        target 3
    ]
    edge [
        source 3
        target 1
    ]
]

Result:

{
	"nodes": [
		{
			"id": 1,
			"label": "\"1\"",
			"attributes": {
				"partition": "1"
			}
		},
		{
			"id": 2,
			"label": "\"2\"",
			"attributes": {
				"partition": "0"
			}
		},
		{
			"id": 3,
			"label": "\"3\"",
			"attributes": {
				"partition": "1"
			}
		}
	],
	"edges": [
		{
			"source": 1,
			"target": 2,
			"attributes": {}
		},
		{
			"source": 2,
			"target": 3,
			"attributes": {}
		},
		{
			"source": 3,
			"target": 1,
			"attributes": {}
		}
	]
}

Comment thread src/main/java/edu/kit/provideq/toolbox/format/gml/Gml.java
Comment thread src/main/java/edu/kit/provideq/toolbox/format/gml/Gml.java Outdated
Comment thread src/main/java/edu/kit/provideq/toolbox/format/gml/Gml.java
Comment thread src/main/java/edu/kit/provideq/toolbox/format/gml/Gml.java
Comment thread src/main/java/edu/kit/provideq/toolbox/maxcut/MaxCutController.java Outdated
Comment thread src/test/java/edu/kit/provideq/toolbox/format/GmlTests.java
Comment thread src/test/java/edu/kit/provideq/toolbox/format/GmlTests.java Outdated
Comment thread src/main/java/edu/kit/provideq/toolbox/maxcut/MaxCutController.java Outdated
Comment thread src/main/java/edu/kit/provideq/toolbox/maxcut/MaxCutController.java Outdated
@schweikart schweikart merged commit 332c509 into develop Jul 30, 2023
@schweikart schweikart mentioned this pull request Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants