matlab圖論工具箱_第1頁
matlab圖論工具箱_第2頁
matlab圖論工具箱_第3頁
matlab圖論工具箱_第4頁
matlab圖論工具箱_第5頁
已閱讀5頁,還剩9頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、 MATGRAPH BY EXAMPLE 27 three one eight five two nine seven four six F IGURE 12. A drawing of a graph read into M ATGRAPH via the graph parser program. F IGURE 13. A picture of Q4 produced by exporting a graph from M ATGRAPH and then laid out using GraphViz. M ATGRAPH can save graphs in a format tha

2、t can be read by OmniGrafe. The M ATGRAPH command graffle(g,filename.graffle writes the graph to disk. Double clicking the created le launches OmniGrafe. Heres an example: cube(g,3 graffle(g,cube.graffle Using OmniGrafes layout tool, we can produce a nice embedding of the graph as shown in Figure 14

3、. 28 EDWARD SCHEINERMAN F IGURE 14. A picture of Q4 produced by exporting a graph from M ATGRAPH and then laid out using OmniGrafe. To a limited extent, it is possible to convert graphs prepared in OmniGrafe for import into M ATInside the matgraph/tools directory resides a program named graffle2sgf.

4、py. This is a Python language program so, in order to run it you must have Python installed on your computer. This program takes as input a graph saved by OmniGrafe and returns as output a matrix specifying the graph in Simple Graph Format (see 9.2. Suppose you have created a graph using OmniGrafe a

5、nd saved it on your hard disk in a le called mygraph.graffle. Issue the following command in the Unix shell: ./graffle2sgf.py mygraph This reads the graph saved by OmniGrafe and writes the relevant data into the le mygraph. Now, inside MATLAB, do the following: load mygraph sgf(g,mygraph g Graph wit

6、h 5 vertices and 6 edges (full The MATLAB command load mygraph reads the le mygraph and saves the matrix contained therein into a variable that is also named mygraph. The command sgf(g,mygraph overwrites g with the graph specied by the SGF matrix mygraph. The graffle2sgf.py tool is not completely re

7、liable. It works well on diagrams that contain only nodes and edges. If there are other extraneous lines or text in the diagram (which an OmniGrafe diagram certainly may have, then the program can get confused and give poor performance. Readers are invited to submit a better version. GRAPH . MORE , D EPARTMENT OF A PPLIED M ATHEMATI

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論