我需要学习如何设计DFA,以便给定任何数字'n',它接受二进制字符串{0,1},其十进制等效数可以被'n'整除.
不同的'n'会有不同的DFA,但有人可以给出一个基本的方法,我应该遵循任何数字0 <n <10.
我成功安装graphviz和cgraph使用
$ sudo pip install graphviz
....
Successfully installed graphviz-0.5.1
$ sudo pip install cgraph
...
Successfully installed cgraph-0.1
Run Code Online (Sandbox Code Playgroud)
我No package 'libcgraph' found在跑步时遇到了这个问题sudo pip install pygraphviz.下面是完整的堆栈跟踪.
$ sudo pip install pygraphviz
The directory '/Users/sparkandshine/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The …Run Code Online (Sandbox Code Playgroud) import pygraphviz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pygraphviz/__init__.py", line 58, in <module>
from .agraph import AGraph, Node, Edge, Attribute, ItemAttribute, DotError
File "/usr/local/lib/python2.7/dist-packages/pygraphviz/agraph.py", line 26, in <module>
from . import graphviz as gv
File "/usr/local/lib/python2.7/dist-packages/pygraphviz/graphviz.py", line 28, in <module>
_graphviz = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/pygraphviz/graphviz.py", line 24, in swig_import_helper
_mod = imp.load_module('_graphviz', fp, pathname, description)
ImportError: /usr/local/lib/python2.7/dist-packages/pygraphviz/_graphviz.so: undefined symbol: Agundirected
Run Code Online (Sandbox Code Playgroud)
我已经尝试过了
pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
Run Code Online (Sandbox Code Playgroud)
我也试过这个答案,但仍然无法正常工作
我在macOS 10.10.5上安装pygraphviz时遇到了麻烦.我有一个功能齐全的Python 2.7.x安装,我想运行排队工具的测试示例,这需要使用pip安装pygraphviz.
执行命令时pip install pygraphviz,我收到以下冗长的错误消息:
Collecting pygraphviz
Using cached pygraphviz-1.3.1.zip
Building wheels for collected packages: pygraphviz
Running setup.py bdist_wheel for pygraphviz ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/x3/nr48r8q10dv1lb9l9t_yx7kh0000gq/T/pip-build-Ljj4Ox/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/x3/nr48r8q10dv1lb9l9t_yx7kh0000gq/T/tmpcYcoACpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.10-x86_64-2.7
creating build/lib.macosx-10.10-x86_64-2.7/pygraphviz
copying pygraphviz/__init__.py -> build/lib.macosx-10.10-x86_64-2.7/pygraphviz
copying pygraphviz/agraph.py -> build/lib.macosx-10.10-x86_64-2.7/pygraphviz
copying pygraphviz/graphviz.py -> build/lib.macosx-10.10-x86_64-2.7/pygraphviz
copying pygraphviz/release.py -> build/lib.macosx-10.10-x86_64-2.7/pygraphviz …Run Code Online (Sandbox Code Playgroud)