Created
July 11, 2012 23:47
-
-
Save t-ob/3094509 to your computer and use it in GitHub Desktop.
Graph tour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn graph-tour [edges] | |
(let [vertices (reduce #(into %1 %2) #{} edges) | |
degree (fn [vertex] (count (filter #(some #{vertex} %) edges)))] | |
(<= (count (filter odd? (map degree vertices))) 2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment