{"action":"closed","issue":{"url":"https://api.github.com/repos/gonum/gonum/issues/625","repository_url":"https://api.github.com/repos/gonum/gonum","labels_url":"https://api.github.com/repos/gonum/gonum/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/gonum/gonum/issues/625/comments","events_url":"https://api.github.com/repos/gonum/gonum/issues/625/events","html_url":"https://github.com/gonum/gonum/issues/625","id":372022236,"node_id":"MDU6SXNzdWUzNzIwMjIyMzY=","number":625,"title":"graph/encoding/dot: reconsider strict parameter on Marshal","user":{"login":"32bitkid","id":73438,"node_id":"MDQ6VXNlcjczNDM4","avatar_url":"https://avatars0.githubusercontent.com/u/73438?v=4","gravatar_id":"","url":"https://api.github.com/users/32bitkid","html_url":"https://github.com/32bitkid","followers_url":"https://api.github.com/users/32bitkid/followers","following_url":"https://api.github.com/users/32bitkid/following{/other_user}","gists_url":"https://api.github.com/users/32bitkid/gists{/gist_id}","starred_url":"https://api.github.com/users/32bitkid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/32bitkid/subscriptions","organizations_url":"https://api.github.com/users/32bitkid/orgs","repos_url":"https://api.github.com/users/32bitkid/repos","events_url":"https://api.github.com/users/32bitkid/events{/privacy}","received_events_url":"https://api.github.com/users/32bitkid/received_events","type":"User","site_admin":false},"labels":[{"id":1064041851,"node_id":"MDU6TGFiZWwxMDY0MDQxODUx","url":"https://api.github.com/repos/gonum/gonum/labels/stability","name":"stability","color":"98db74","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-19T16:08:16Z","updated_at":"2018-10-29T12:46:50Z","closed_at":"2018-10-29T12:46:50Z","author_association":"CONTRIBUTOR","body":"### Background\r\n\r\nThe `Marshal()` function takes a final boolean parameter that will prefix the emitted DOT encoded graph with the `strict` keyword. This, according to the DOT documentation:\r\n\r\n> ...forbids the creation of multi-edges, i.e., there can be at most one edge with a given tail node and head node in the directed case. For undirected graphs, there can be at most one edge connected to the same two nodes. Subsequent edge statements using the same two nodes will identify the edge with the previously defined one and apply any attributes given in the edge statement.\r\n\r\nGiven that a `graph.Graph` is the interface for a _simple_ graph, it is not really _possible_ to construct a _non_-strict DOT graph in this form. A `graph.Multigraph` may, or _may not_, be a strict graph, it depends on the topology of the graph.\r\n\r\n### Proposal\r\n\r\n- Remove the `strict` parameter from `Marshal()`, and make `Marshal(graph.Graph)` _always_ serialize a `strict` dot graph.\r\n- Remove the `strict` parameter from `MarshalMulti()` and make `MarshalMulti(graph.Multigraph)` _always_ serialize a non-strict graph\r\n\r\nThis would simplify the arguments for both functions, and reduce the likelihood of serializing an invalid DOT graph.\r\n\r\n- Introduce a new pair of helper functions to convert a `graph.Graph` to a `graph.Multigraph` and _vice-versa_. This has an advantage over doing `strict` checking during serialization, as it is an explicit action to perform/verify the conversion, and errors can be handled explicitly, _e.g._ loading a multigraph and altering it in a way that should result in a simple graph, then outputting it is a `strict` DOT graph. \r\n\r\n### Potential implementation challenges\r\n\r\nI'm not quite sure how to transfer custom DOT serialization properties through the conversion process.\r\n\r\n### Potential impact of proposal\r\n\r\nThe signature of `Marshal()` will change and be incompatible with previous versions.\r\n"}}
{"actor":{"display_login":"kortschak"}}