<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>I think I wrote the reader a few years back ... I don't recall developing the writer though. </div>
<div><br>
</div>
<div>I added some expanded documentation earlier today to the reader which should go in when I commit. </div>
<div><br>
</div>
<div>DIMACS has definitely been a format that's varied a bit over time. In a nutshell, the reader looks for the problem specification line (the p <problem> V E line). If it finds one that it has a specific reader built for it then it'll load the problem-specific
information. Otherwise it just loads the graph as a generic graph. </div>
<div><br>
</div>
<div>Currently, I think I only put in specific readers for the max-flow problem (p max n e) or the coloring problem (p edge n e), otherwise specifics are ignored. It should also be tolerant of edges being labeled with either an 'a' or an 'e'. I think I opted
to go with floating point values since they'll also work for integers.</div>
<div><br>
</div>
<div>Somehow I don't think the DIMACS reader/writers have been used much since the filters have been in for a while now and this error hadn't been caught yet ;-) Things should be a bit better when I push out my fixes later on today or tomorrow.</div>
<div><br>
</div>
<div>-William</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"Eric E. Monson" <<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 22 Jun 2011 15:51:15 -0400<br>
<span style="font-weight:bold">To: </span>William C McLendon <<a href="mailto:wcmclen@sandia.gov">wcmclen@sandia.gov</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a> Developers" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [vtk-developers] vtkDIMACS reader/writer bug<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>It's a strange format, though, that's changed over time depending on which "challenge" it's being used in. I see that this 9th challenge is the one linked from the doxygen page, but the reader also seems to accept some form of the 2nd challenge format
with "n" node descriptor lines and "e" instead of "a" for edges. Also, in all the formats I've seen today they seem to describe any "weight" values as integers, but the VTK writer/reader seems to use/accept floating point values...</div>
<div><br>
</div>
<div>So, as long as you're making changes, it might be good to update the documentation to not just specify the 1...n IDs, but to clarify what formats are acceptable. Also, if it really needs 1...n IDs with no gaps, is there any guarantee that an arbitrary
graph someone constructs will have all sequential IDs?</div>
<div><br>
</div>
<div>Anyway, I'm glad the immediate problem seems to be solved.</div>
<div><br>
</div>
<div>Talk to you later,</div>
<div>-Eric</div>
<div><br>
</div>
<br>
<div>
<div>On Jun 22, 2011, at 3:15 PM, Mclendon, William C III wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Ah! I didn't look closely at the DIMACS file specs at <a href="http://www.dis.uniroma1.it/~challenge9/format.shtml#graph">http://www.dis.uniroma1.it/~challenge9/format.shtml#graph</a>:</div>
<div><br>
</div>
<div><img src="http://www.dis.uniroma1.it/%7Echallenge9/images/bullet-orange.gif" height="10" width="8"> A graph contains
<i>n </i>nodes and <i>m </i>arcs<br>
<b><img src="http://www.dis.uniroma1.it/%7Echallenge9/images/bullet-orange.gif" height="10" width="8"> Nodes are identified by integers 1...</b><i><b>n</b></i><br>
<img src="http://www.dis.uniroma1.it/%7Echallenge9/images/bullet-orange.gif" height="10" width="8"> Graphs can be interpreted as directed or undirected, depending on the problem being studied<br>
<img src="http://www.dis.uniroma1.it/%7Echallenge9/images/bullet-orange.gif" height="10" width="8"> Graphs can have parallel arcs and self-loops<br>
<img src="http://www.dis.uniroma1.it/%7Echallenge9/images/bullet-orange.gif" height="10" width="8"> Arc weights are signed integers</div>
<div><br>
</div>
<div>It looks like the writer is happily writing out files with vertices from 0..n-1 rather than 1..n. </div>
<div><br>
</div>
<div>I'll toss in a couple checks into the code this afternoon to make the writer generate vertices numbered from 1..n and the reader to add a check to generate a useful warning message if it detects a vertex 0...</div>
<div><br>
</div>
<div>Thanks for providing a few extra pairs of eyeballs... :D</div>
<div><br>
</div>
<div>-William</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>"Eric E. Monson" <<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 22 Jun 2011 14:52:34 -0400<br>
<span style="font-weight:bold">To: </span>William C McLendon <<a href="mailto:wcmclen@sandia.gov">wcmclen@sandia.gov</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a> Developers" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [vtk-developers] vtkDIMACS reader/writer bug<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;" type="cite">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Yup, if I add one to the source and target IDs in the writer code, I don't seem to get the crashes any more. Maybe there are other things wrong, too, but that seems to fix it for me.
<div><br>
</div>
<div>-Eric</div>
<div><br>
</div>
<div><br>
<div>
<div>On Jun 22, 2011, at 2:46 PM, Eric E. Monson wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
You know, it looks like the graph reader doesn't like node IDs of 0, it likes them to start with 1. If I write out a simpler graph with only 10 nodes, then manually increment each node ID in the file by 1 so they start with 1 instead of 0, it works.
<div><br>
</div>
<div>-Eric</div>
<div><br>
</div>
<div><br>
<div>
<div>On Jun 22, 2011, at 1:47 PM, Mclendon, William C III wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>I'm trying to run a script that just generates a random graph and saves it using the DIMACS writer then reads it back using the DIMACS reader. Unfortunately, when I try to render the graph I get a segfault.</div>
<div><br>
</div>
<div>It seems odd since the graphs seem to load properly. The attached script seems to be crashing for me on both OS-X and under Linux.</div>
<div><br>
</div>
<div>-William</div>
</div>
<span><dimacs.py></span>_______________________________________________<br>
Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</span>
</body>
</html>