Group Abstract Group Abstract

Message Boards Message Boards

Search for specific Graphs given their features in W|A?

Posted 10 years ago

Hi. I'm not sure if this is the right place to post but I was just wondering if there was any way you could take features from the "Graph features" section of the results and input them into the search for it to find graphs that fulfill those specific features you choose. For example, I want to find a graph that is nonhamiltonian, eulerian, perfect matching, and planar. How would I go about doing that?

picture

POSTED BY: D YQ

I'm not familiar with a way to do that inside Wolfram Alpha itself, which I think is what you're after. But since you found the forum for the Wolfram language... just in case you're curious, an example of how you could do it via Wolfram programming (if you haven't already learned Wolfram programming). What's described below would be done in a Wolfram programming environment (e.g. Wolfram Development Platform), not Wolfram Alpha itself.

To get a list of all the graph classes available (including Eulerian, Planar, etc):

availableGraphClasses = GraphData["Classes"]

To list all the properties you can display for a graph:

availableProperties = Complement @@ GraphData /@ {"Properties", "Classes"}

The graph classes you want all the search results to belong to:

graphClasses = {"Nonhamiltonian", "Eulerian", "PerfectMatching", 
"Planar"};

Retrieve the graphs that belong to all the classes you've specified:

searchResults = Intersection @@ Map[GraphData[#] &, graphClasses]

Put it all together, and generate a viewer to display whatever properties you want for the graphs retrieved:

propertiesToDisplay = {"AdjacencyMatrix", "AllImages", 
"CanonicalForm", "Center", 
"EdgeCount", "EdgeRules", "Information", "StandardNames", 
"VertexCount"};
graphClasses = {"Nonhamiltonian", "Eulerian", "PerfectMatching", 
"Planar"};
searchResults = Intersection @@ Map[GraphData[#] &, graphClasses]
Manipulate[Column[{GraphData[g], GraphData[g, p]}], {g, 
graphSearchResults}, {p, propertiesToDisplay}]

Example viewer, with just a few properties displayed, following examples in documentation

Anyways, I know you're probably looking for a purely Wolfram Alpha solution, but I just thought I'd toss that out there in case you were curious. Best wishes...

https://www.wolframcloud.com/objects/1833d555-f964-4a02-96d2-bf6e19a50ea7

POSTED BY: Michael Hamel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard